scaler
AnomalyMeanScaler(anomaly_detector, rolling=True, window_size=250)
¶
Bases: AnomalyScaler
Wrapper around an anomaly detector that scales the model's output by the incremental mean of previous scores.
PARAMETER | DESCRIPTION |
---|---|
anomaly_detector |
The anomaly detector to wrap.
TYPE:
|
metric_type |
The type of metric to use.
|
rolling |
Choose whether the metrics are rolling metrics or not.
TYPE:
|
window_size |
The window size used for mean computation if rolling==True.
DEFAULT:
|
score_one(*args)
¶
Return a scaled anomaly score based on raw score provided by the wrapped anomaly detector. Larger values indicate more anomalous examples.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
An scaled anomaly score. Larger values indicate more
|
|
anomalous examples.
|
|
AnomalyMinMaxScaler(anomaly_detector, rolling=True, window_size=250)
¶
Bases: AnomalyScaler
Wrapper around an anomaly detector that scales the model's output to \([0, 1]\) using rolling min and max metrics.
PARAMETER | DESCRIPTION |
---|---|
anomaly_detector |
The anomaly detector to wrap.
TYPE:
|
rolling |
Choose whether the metrics are rolling metrics or not.
TYPE:
|
window_size |
The window size used for the metrics if rolling==True
TYPE:
|
score_one(*args)
¶
Return a scaled anomaly score based on raw score provided by the wrapped anomaly detector. Larger values indicate more anomalous examples.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
An scaled anomaly score. Larger values indicate more
|
|
anomalous examples.
|
|
AnomalyScaler(anomaly_detector)
¶
Bases: Wrapper
, AnomalyDetector
Wrapper around an anomaly detector that scales the output of the model to account for drift in the wrapped model's anomaly scores.
PARAMETER | DESCRIPTION |
---|---|
anomaly_detector |
Anomaly detector to be wrapped.
TYPE:
|
learn_one(*args)
¶
Update the scaler and the underlying anomaly scaler.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
AnomalyScaler
|
The model itself. |
score_many(*args)
abstractmethod
¶
Return scaled anomaly scores based on raw score provided by the wrapped anomaly detector.
A high score is indicative of an anomaly. A low score corresponds to a normal observation.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
Scaled anomaly scores. Larger values indicate more anomalous examples.
|
|
score_one(*args)
abstractmethod
¶
Return a scaled anomaly score based on raw score provided by the wrapped anomaly detector.
A high score is indicative of an anomaly. A low score corresponds to a normal observation.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
An scaled anomaly score. Larger values indicate
|
|
more anomalous examples.
|
|
AnomalyStandardScaler(anomaly_detector, with_std=True, rolling=True, window_size=250)
¶
Bases: AnomalyScaler
Wrapper around an anomaly detector that standardizes the model's output using incremental mean and variance metrics.
PARAMETER | DESCRIPTION |
---|---|
anomaly_detector |
The anomaly detector to wrap.
TYPE:
|
with_std |
Whether to use standard deviation for scaling.
TYPE:
|
rolling |
Choose whether the metrics are rolling metrics or not.
TYPE:
|
window_size |
The window size used for the metrics if rolling==True.
TYPE:
|
score_one(*args)
¶
Return a scaled anomaly score based on raw score provided by the wrapped anomaly detector. Larger values indicate more anomalous examples.
PARAMETER | DESCRIPTION |
---|---|
*args |
Depends on whether the underlying anomaly detector is supervised or not.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
An scaled anomaly score. Larger values indicate more
|
|
anomalous examples.
|
|