Anomaly aggregators base classes
- class darts.ad.aggregators.aggregators.Aggregator(*args, **kwargs)[source]¶
Bases:
abc.ABC
Methods
eval_accuracy
(actual_anomalies, series[, ...])Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
predict
(series)Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- eval_accuracy(actual_anomalies, series, window=1, metric='recall')[source]¶
Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
- Parameters
actual_anomalies (
Sequence
[TimeSeries
]) – The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)series (
Sequence
[TimeSeries
]) – The (sequence of) multivariate binary series to aggregatewindow (
int
) – (Sequence of) integer value indicating the number of past samples each point represents in the (sequence of) series. The parameter will be used by the function_window_adjustment_anomalies()
in darts.ad.utils to transform actual_anomalies.metric (
str
) – Metric function to use. Must be one of “recall”, “precision”, “f1”, and “accuracy”. Default: “recall”
- Returns
(Sequence of) score for the (sequence of) series
- Return type
Union[float, Sequence[float]]
- abstract predict(series)[source]¶
Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- Parameters
series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The (sequence of) multivariate binary series to aggregate- Returns
(Sequence of) aggregated results
- Return type
- class darts.ad.aggregators.aggregators.FittableAggregator[source]¶
Bases:
darts.ad.aggregators.aggregators.Aggregator
Base class of Aggregators that do need training.
Methods
eval_accuracy
(actual_anomalies, series[, ...])Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
fit
(actual_anomalies, series)Fit the aggregators on the (sequence of) multivariate binary series.
predict
(series)Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- eval_accuracy(actual_anomalies, series, window=1, metric='recall')¶
Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
- Parameters
actual_anomalies (
Sequence
[TimeSeries
]) – The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)series (
Sequence
[TimeSeries
]) – The (sequence of) multivariate binary series to aggregatewindow (
int
) – (Sequence of) integer value indicating the number of past samples each point represents in the (sequence of) series. The parameter will be used by the function_window_adjustment_anomalies()
in darts.ad.utils to transform actual_anomalies.metric (
str
) – Metric function to use. Must be one of “recall”, “precision”, “f1”, and “accuracy”. Default: “recall”
- Returns
(Sequence of) score for the (sequence of) series
- Return type
Union[float, Sequence[float]]
- fit(actual_anomalies, series)[source]¶
Fit the aggregators on the (sequence of) multivariate binary series.
If a list of series is given, they must have the same number of components.
- Parameters
actual_anomalies (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The (sequence of) multivariate binary series
- predict(series)[source]¶
Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- Parameters
series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The (sequence of) multivariate binary series to aggregate- Returns
(Sequence of) aggregated results
- Return type
- class darts.ad.aggregators.aggregators.NonFittableAggregator[source]¶
Bases:
darts.ad.aggregators.aggregators.Aggregator
Base class of Aggregators that do not need training.
Methods
eval_accuracy
(actual_anomalies, series[, ...])Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
predict
(series)Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- eval_accuracy(actual_anomalies, series, window=1, metric='recall')¶
Aggregates the (sequence of) multivariate series given as input into one (sequence of) series and evaluates the results against true anomalies.
- Parameters
actual_anomalies (
Sequence
[TimeSeries
]) – The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)series (
Sequence
[TimeSeries
]) – The (sequence of) multivariate binary series to aggregatewindow (
int
) – (Sequence of) integer value indicating the number of past samples each point represents in the (sequence of) series. The parameter will be used by the function_window_adjustment_anomalies()
in darts.ad.utils to transform actual_anomalies.metric (
str
) – Metric function to use. Must be one of “recall”, “precision”, “f1”, and “accuracy”. Default: “recall”
- Returns
(Sequence of) score for the (sequence of) series
- Return type
Union[float, Sequence[float]]
- predict(series)[source]¶
Aggregates the (sequence of) multivariate binary series given as input into a (sequence of) univariate binary series.
- Parameters
series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The (sequence of) multivariate binary series to aggregate- Returns
(Sequence of) aggregated results
- Return type