Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anomaly Detection (anomaly model, scorer, detector, aggregator) (#1256)
* AD first Ver * AD first Version * added ForecastingAnomalyModel/FilteringAnomalyModel, and scorers: KmeansAnomaly/LocalOutlierFactorAnomaly * implemented GaussianMixtureScorer and allow multiple scorer inputs * Added comments and possibility to input a list of scorers in AnomalyModel * Clean whitespace * Clean whitespace2 * Clean whitespace2 * Clean whitespace with VScode * Changed diff() position and added characteristic_length parameters * renamed submodule * small changes * small improvements * small changes * Accepts all types UTS, MTS, list(UTS or MTS) * move _diff() in child, so that scorers have all the same signature * replaced L1, L2, and Abs_diff with Norm * add component_wise to WassersteinScorer * add component_wise to Kmeans * add component_wise to LOF * add component_wise to GaussianMixture * Accept num_samples for probabilistic models forecasting * Minor changes * add comments, add likelihood * add laplace, + window parameter + parameter alllow_retrain * add cauchy and gamma likelihood * add utils.py, detectors, aggregators * removed show function for now * add show_anomalies() and show_anomalies_from_scores() * small changes * Some docstring improvements to AnomalyModels * corrected Kmeans, LFO and Gaussian Scorer + added input from PR * test commit * negative LFO and gaussian * pre pull * from prediciton structure * improved show_anomalies, changed structure _from_prediction * small mistake in eval_accuracy in utils.py * return type of eval_acc * changed way eval_acc returns in anomaly_model * added test for agg, dect, and scorers. upgrade agg trainable * added parameter return_UTS, and added test for scorers and anomaly_model * small mistake in anomaly_model * New structure in files * Added warnings * small change in wasserstein * filtering_am and forecasting_am * Small improvements * Fix test names * add pyod to requirements * rename scorers * scorers imports * Changed handling of kwargs in AD models * update tests * return single TimeSeries from score() in some cases * small naming improvements * Some improvements to anomaly models * Small improvements to scorers * Some small improvements * Fix tests * Norm scorer docstring * test toy example agg and detectors * small docstring improvements * Add vectorization todos * test toy example scorers * test toy example scorers * test toy example PyOD * test toy example NLL scorers * test toy example poisson nll scorer * test toy example univariate anomaly_models * test toy example univariate covariates forecasting_anomaly_models * update threshold detector docstring * change way to output string messages * first implementation of julien H's PR review * first implementation of julien H's PR review 2 * anomaly_model forecasting multivariate test * anomaly_model multivariate, w=1,2, len()=2 test for NLL scorers * changed NLL scorers: call scipy.stats function * changed in anomaly_models (inner to outer for series and scorers) * Small changes to PyOD detector * improvements to wasserstein scorer docstring * change in eval acc * change in eval acc, new function _eval_accuracy_from_scores * Small improvements to aggregators * Small docstrings improvements * Utils docstring * change in detectors (vectorization and accepts list of param if multivariate) * remove exp in PyODScorer... and updated test * new test with np.testing * agg accept only MTS or sequence of MTS * removed old detectors * new multivariate test for filtering anomaly model * small changes to utils docstrings * test assert_array_almost_equal decimal 2 * test assert_array_almost_equal decimal 1 * test assert_array_almost_equal decimal 1 * second implementation of julien H's PR review * vectorization of NLL scorers * problem with test_univariate_FilteringAnomalyModel * replace abs by __abs__ in test_univariate_covariate_ForecastingAnomalyModel * replace abs by __abs__ in ALL test_univariate_covariate_ForecastingAnomalyModel * Increase coverage of scorers tests * Imports in submodules * Some improvements to utils * Some improvements * significant rework of quantile detector * Rework threshold detector * Rework NLL scorers * Rename NLL scorers files * vectorize windowing in k-means * vectorization of windowing in PyOD and Wasserstein * Docstring improvements * Update darts/ad/anomaly_model/filtering_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/filtering_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/filtering_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/filtering_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/filtering_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/__init__.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/__init__.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/anomaly_model/forecasting_am.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/scorers/__init__.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/scorers/scorers.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/scorers/scorers.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/scorers/scorers.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Update darts/ad/scorers/kmeans_scorer.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * PR comments * Formatting * Update darts/ad/scorers/pyod_scorer.py Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> * Small docstring improvement Co-authored-by: Julien Adda <julienadda@Juliens-MacBook-Pro.local> Co-authored-by: Julien Adda <julienadda@Juliens-MBP.localdomain> Co-authored-by: Julien Herzen <julien@unit8.co> Co-authored-by: Julien Adda <julienadda@juliens-macbook-pro.home> Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com>
- Loading branch information