diff options
author | vkalintiris <vasilis@netdata.cloud> | 2023-04-13 20:29:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 20:29:52 +0300 |
commit | 003df5f2b76973f898b44742b7e071ff2654343a (patch) | |
tree | 46183f6a35edb887ab8f3de8a1d6e398438a6a0f /ml/Config.cc | |
parent | 40f69dc20f7e40b7155d29a3f735ec4af29f4865 (diff) |
Save and load ML models (#14810)
* Revert "Revert "Use static thread-pool for training. (#14702)" (#14782)"
This reverts commit 5321ca8d1ef8d974a6a2b2128ca8804de6acb693.
* Model I/O.
* Minor changes
Meant to make debugging a crash issues easier
on cloud VMs:
- Less verbose logging
- Higher logging history
- Modify installer to use debug info by default
* Fix ML initialization order.
* read lock hosts when running detection.
* Revert debugging changes.
* Update ml/Config.cc
Co-authored-by: Andrew Maguire <andrewm4894@gmail.com>
---------
Co-authored-by: Andrew Maguire <andrewm4894@gmail.com>
Diffstat (limited to 'ml/Config.cc')
-rw-r--r-- | ml/Config.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ml/Config.cc b/ml/Config.cc index 8b04590d77..415d11b838 100644 --- a/ml/Config.cc +++ b/ml/Config.cc @@ -34,7 +34,7 @@ void ml_config_load(ml_config_t *cfg) { unsigned smooth_n = config_get_number(config_section_ml, "num samples to smooth", 3); unsigned lag_n = config_get_number(config_section_ml, "num samples to lag", 5); - double random_sampling_ratio = config_get_float(config_section_ml, "random sampling ratio", 1.0 / lag_n); + double random_sampling_ratio = config_get_float(config_section_ml, "random sampling ratio", 1.0 / 5.0 /* default lag_n */); unsigned max_kmeans_iters = config_get_number(config_section_ml, "maximum number of k-means iterations", 1000); double dimension_anomaly_rate_threshold = config_get_float(config_section_ml, "dimension anomaly score threshold", 0.99); @@ -43,6 +43,10 @@ void ml_config_load(ml_config_t *cfg) { std::string anomaly_detection_grouping_method = config_get(config_section_ml, "anomaly detection grouping method", "average"); time_t anomaly_detection_query_duration = config_get_number(config_section_ml, "anomaly detection grouping duration", 5 * 60); + size_t num_training_threads = config_get_number(config_section_ml, "num training threads", 4); + + bool enable_statistics_charts = config_get_boolean(config_section_ml, "enable statistics charts", false); + /* * Clamp */ @@ -64,6 +68,8 @@ void ml_config_load(ml_config_t *cfg) { host_anomaly_rate_threshold = clamp(host_anomaly_rate_threshold, 0.1, 10.0); anomaly_detection_query_duration = clamp<time_t>(anomaly_detection_query_duration, 60, 15 * 60); + num_training_threads = clamp<size_t>(num_training_threads, 1, 128); + /* * Validate */ @@ -109,4 +115,8 @@ void ml_config_load(ml_config_t *cfg) { cfg->sp_charts_to_skip = simple_pattern_create(cfg->charts_to_skip.c_str(), NULL, SIMPLE_PATTERN_EXACT, true); cfg->stream_anomaly_detection_charts = config_get_boolean(config_section_ml, "stream anomaly detection charts", true); + + cfg->num_training_threads = num_training_threads; + + cfg->enable_statistics_charts = enable_statistics_charts; } |