-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/anomaly detection api #1477
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1477 +/- ##
==========================================
- Coverage 93.79% 93.71% -0.08%
==========================================
Files 138 138
Lines 14285 14295 +10
==========================================
- Hits 13398 13396 -2
- Misses 887 899 +12 ☔ View full report in Codecov by Sentry. |
…nit8co/darts into refactor/anomaly_detection_API
* Added anomaly display cell and comments * Added samuele comments Co-authored-by: julien12234 <julien.adda@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @julien12234 ! I only have minor comments. Would be great to merge sometime soon. You have a couple of merge conflicts to sort out first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments about the metric
argument that should probably be a Literal
, the order of the argument (notably for series
and anomalie
) might benefit from a slight change for some methods.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
* Added support for specifying PyTorch activation functions (`ReLU`, `Sigmoid`, `Tanh`, or `None`) in the `BlockRNNModel`. * Ensured that activation functions are applied between fully connected layers, but not as the final layer. * Implemented a check to raise an error if an activation function is set but the model only contains one linear layer. * Updated documentation to reflect the new activation parameter and usage examples. * Added test cases to verify the correct application of activation functions and to handle edge cases.
Summary
Edit, @dennisbader (2024-05-10 15:19:00)
FittableWindowScorer
(KMeans, PyOD, and Wasserstein Scorers) now accept any of darts "per-time" step metrics as difference functiondiff_fn
.ForecastingAnomalyModel
is now much faster thanks to optimized historical forecasts to generate the prediction input for the scorers. We also added more control over the historical forecasts generation through additional parameters in all model methods.FittableWindowScorer
(KMeans, PyOD, and Wasserstein Scorers) now expectsdiff_fn
to be one of Darts "per-time" step metricsForecastingAnomalyModel
:model
is now enforced to be aGlobalForecastingModel
*.eval_accuracy()
: (Aggregators, Detectors, Filtering/Forecasting Anomaly Models, Scorers)eval_metric()
:actual_anomalies
toanomalies
, andanomaly_score
topred_scores
*.show_anomalies()
: (Filtering/Forecasting Anomaly Models, Scorers)actual_anomalies
toanomalies
*.fit()
(Filtering/Forecasting Anomaly Models)actual_anomalies
toanomalies
Scorer.*_from_prediction()
(Scorers)eval_accuracy_from_prediction()
toeval_metric_from_prediction()
actual_series
toseries
, andactual_anomalies
toanomalies
darts.ad.utils.eval_accuracy_from_scores
:eval_metric_from_scores
actual_anoamlies
toanomalies
, andanomaly_score
topred_scores
darts.ad.utils.eval_accuracy_from_binary_prediction
:eval_metric_from_binary_prediction
actual_anoamlies
toanomalies
, andbinary_pred_anomalies
topred_anomalies
darts.ad.utils.show_anomalies_from_scores
:series
toactual_series
,actual_anomalies
toanomalies
,model_output
topred_series
, andanomaly_scores
topred_scores
TimeSeries
:with_times_and_values()
, which returns a new series with a new time index and new values but with identical columns and metadata as the series called from (static covariates, hierarchy).slice_intersect_times()
, which returns the sliced time index of a series, where the index has been intersected with another series.with_values()
now also acts on array-likevalues
rather than only on numpy arrays.Original description:
Some refactoring and upgrading of the anomaly detection API: