{"id":15044676,"url":"https://github.com/elastic/ml-cpp","last_synced_at":"2025-04-13T00:43:09.579Z","repository":{"id":37711661,"uuid":"122193808","full_name":"elastic/ml-cpp","owner":"elastic","description":"Machine learning C++ code","archived":false,"fork":false,"pushed_at":"2025-04-11T08:54:05.000Z","size":217445,"stargazers_count":152,"open_issues_count":92,"forks_count":64,"subscribers_count":314,"default_branch":"main","last_synced_at":"2025-04-13T00:43:04.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-20T12:13:16.000Z","updated_at":"2025-04-11T08:54:10.000Z","dependencies_parsed_at":"2023-10-17T10:09:14.658Z","dependency_job_id":"9adf01e6-277a-4218-8d1c-f0316a86f5eb","html_url":"https://github.com/elastic/ml-cpp","commit_stats":{"total_commits":1202,"total_committers":25,"mean_commits":48.08,"dds":0.7013311148086523,"last_synced_commit":"aeb442e6147ce6d40cd51d8465cb73d81cff175c"},"previous_names":[],"tags_count":204,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fml-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fml-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fml-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fml-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/ml-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650418,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:50:53.655Z","updated_at":"2025-04-13T00:43:09.558Z","avatar_url":"https://github.com/elastic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Machine Learning for the Elastic Stack\n\n\u003chttps://www.elastic.co/what-is/elasticsearch-machine-learning\u003e\n\nThe ml-cpp repo is a part of Machine Learning for the Elastic Stack, which is\navailable with either a trial or platinum license for the\n[Elastic Stack](https://www.elastic.co/products).\n\nThis repo only contains the C++ code that implements the core analytics for\nmachine learning.\n\nCode for integrating into Elasticsearch and source for its documentation can be\nfound in the main\n[elasticsearch repo](https://github.com/elastic/elasticsearch).\n\n## Elastic License Functionality\n\nUsage in production requires that you have a license key that permits use of\nmachine learning features. See [LICENSE.txt](LICENSE.txt) for full information.\n\n## Getting Started\n\nTo get started with Machine Learning please have a look at\n\u003chttps://www.elastic.co/guide/en/machine-learning/current/ml-getting-started.html\u003e.\n\nFull documentation of Machine Learning can be found at\n\u003chttps://www.elastic.co/guide/en/machine-learning/current/index.html\u003e.\n\n## Questions/Bug Reports/Help\n\nWe are happy to help and to make sure your questions can be answered by the\nright people, please follow the guidelines below:\n\n* If you have a general question about functionality please use our\n  [discuss](https://discuss.elastic.co/tag/elastic-stack-machine-learning)\n  forums.\n* If you have a support contract please use your dedicated support channel.\n* For questions regarding subscriptions please\n  [contact](https://www.elastic.co/contact) us.\n* For bug reports, pull requests and feature requests specifically for machine\n  learning analytics, please use this GitHub repository.\n\n## Contributing\n\nPlease have a look at our [contributor guidelines](CONTRIBUTING.md).\n\n## Setting up a build environment\n\nYou don't need to specifically build the C++ components for machine learning as,\nby default, the elasticsearch build will download pre-compiled C++ artifacts.\n\nSetting up a build environment for ml-cpp native code is complex. If you are\nspecifically interested in working with the ml-cpp code, then information\nregarding setting up a build environment can be found in the\n[build-setup](build-setup) directory.\n\nTo use CLion with the project, please refer to the [\"Using CLion\"](build-setup/clion/using_clion.md) tutorial.\n\n## Building\n\n###\n\nIf you do choose to build the project from the command line yourself, for all platforms, the following instructions apply:\n\n* From the top level of the project, source the file `set_env.sh` e.g.\n```\n. ./set_env.sh\n```\nWhen building on Windows from the native command shell that command becomes\n```\n.\\set_env.bat\n```\n\n* Run `cmake -B cmake-build-relwithdebinfo` to generate the build system under the `cmake-build-relwithdebinfo` directory (the `--config RelWithDebInfo` option may be omitted on Linux and Mac).\n* Run `cmake --build cmake-build-relwithdebinfo --config RelWithDebInfo` to build the libraries and the executables for the project (the `--config RelWithDebInfo` option may be omitted on Linux and Mac). This may take some time, to speed up the build you can tell `cmake` to perform a parallel build using the `-j` (jobs) option. e.g.\n```\ncmake --build cmake-build-relwithdebinfo -j 7\n```\n\n* To build and run the unit tests run `cmake --build cmake-build-relwithdebinfo -t test`. Again this can be sped up somewhat by using the `-j` option. e.g.\n```\ncmake --build cmake-build-relwithdebinfo -t test -j 7\n```\n\n## Running\n\nAlthough the executables are designed to be run from `Elasticsearch` it is possible to run them from the command line. This is particularly useful when attempting to debug issues and you have an input data set sufficient to replicate the error.\n\nThe location of the executables differs depending on the platform. \n\n* MacOS: `build/distribution/platform/darwin-x86_64/controller.app/Contents/MacOS/`\n* Linux: `build/distribution/platform/linux-x86_64/bin/`\n* Windows: ` build/distribution/platform/windows-x86_64/bin/`\n\nThe command line arguments will of course differ depending on which executable is being run but each has the `--help` option e.g. `\n\n```\n./build/distribution/platform/linux-x86_64/bin/autodetect --help\nUsage: autodetect [options] [\u003cfieldname\u003e+ [by \u003cfieldname\u003e]]\nOptions::\n  --help                      Display this information and exit\n  --version                   Display version information and exit\n  --limitconfig arg           Optional limit config file\n  --modelconfig arg           Optional model config file\n  --fieldconfig arg           Optional field config file\n  --modelplotconfig arg       Optional model plot config file\n  --jobid arg                 ID of the job this process is associated with\n  --logProperties arg         Optional logger properties file\n  --logPipe arg               Optional log to named pipe\n  --bucketspan arg            Optional aggregation bucket span (in seconds) - \n                              default is 300\n  --latency arg               Optional maximum delay for out-of-order records \n                              (in seconds) - default is 0\n  --summarycountfield arg     Optional field to that contains counts for \n                              pre-summarized input - default is none\n  --delimiter arg             Optional delimiter character for delimited data \n                              formats - default is '' (tab separated)\n  --lengthEncodedInput        Take input in length encoded binary format - \n                              default is delimited\n  --timefield arg             Optional name of the field containing the \n                              timestamp - default is 'time'\n  --timeformat arg            Optional format of the date in the time field in \n                              strptime code - default is the epoch time in \n                              seconds\n  --quantilesState arg        Optional file to quantiles for normalization\n  --deleteStateFiles          If the 'quantilesState' option is used and this \n                              flag is set then delete the model state files \n                              once they have been read\n  --input arg                 Optional file to read input from - not present \n                              means read from STDIN\n  --inputIsPipe               Specified input file is a named pipe\n  --output arg                Optional file to write output to - not present \n                              means write to STDOUT\n  --outputIsPipe              Specified output file is a named pipe\n  --restore arg               Optional file to restore state from - not present\n                              means no state restoration\n  --restoreIsPipe             Specified restore file is a named pipe\n  --persist arg               Optional file to persist state to - not present \n                              means no state persistence\n  --persistIsPipe             Specified persist file is a named pipe\n  --persistInterval arg       Optional time interval at which to periodically \n                              persist model state (Mutually exclusive with \n                              bucketPersistInterval)\n  --persistInForeground       Persistence occurs in the foreground. Defaults to\n                              background persistence.\n  --bucketPersistInterval arg Optional number of buckets after which to \n                              periodically persist model state (Mutually \n                              exclusive with persistInterval)\n  --maxQuantileInterval arg   Optional interval at which to periodically output\n                              quantiles if they have not been output due to an \n                              anomaly - if not specified then quantiles will \n                              only be output following a big anomaly\n  --maxAnomalyRecords arg     The maximum number of records to be outputted for\n                              each bucket. Defaults to 100, a value 0 removes \n                              the limit.\n  --memoryUsage               Log the model memory usage at the end of the job\n  --multivariateByFields      Optional flag to enable multi-variate analysis of\n                              correlated by fields\n\n```\n\nOther executables exist under the `devbin` directory. These are not built by default. To build these you need to explicitly specify a target. \n```\ncmake --build cmake-build-relwithdebinfo -j 7 -t model_extractor\n```\nThe executable is created under the `cmake-build-relwithdebinfo` hierarchy, so to run do\n```\n./cmake-build-relwithdebinfo/devbin/model_extractor/model_extractor --help\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fml-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fml-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fml-cpp/lists"}