Back to models
Detector

HampelDetector

Anomaly detector based on Hampel filter described in [1].

Quickstart

python
from sktime.detection.hampel import HampelDetector

estimator = HampelDetector(window_length=10, n_sigma=3.0, k=1.4826)

Parameters(3)

window_lengthint, optional (default=10)
The size of the sliding window (number of observations).
n_sigmafloat, optional (default=3.0)
The number of standard deviations to use for the outlier threshold.
kfloat, optional (default=1.4826)
The consistency constant which depends on the underlying distribution. By default, we choose k=1.4826 - the value for Gaussian distribution.

Examples

>>> from sktime.detection.hampel import HampelDetector
>>> detector = HampelDetector ()
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> detector. fit (y) HampelDetector()
>>> y_anomalies = detector. predict (y)
>>> anomaly_scores = detector. transform_scores (y)

References

  1. [1 ] Hampel F. R., “The influence curve and its role in robust estimation”, Journal of the American Statistical Association, 69, 382-393, 1974