Zurück zu den Modellen
Transformer

HampelFilter

Use HampelFilter to detect outliers based on a sliding window.

Correction of outliers is recommended by means of the sktime.Imputer, so both can be tuned separately.

Schnellstart

python
from sktime.transformations.outlier_detection import HampelFilter

estimator = HampelFilter(window_length=10, n_sigma=3, k=1.4826, return_bool=False)

Tags

Fähigkeiten

  • Fehlende Werte
  • Reihen ungleicher Länge
  • Multivariat: Nicht unterstützt
  • Inverse Transformation: Nicht unterstützt
  • Entfernt fehlende Werte: Nicht unterstützt
  • Gleicht Reihenlängen an: Nicht unterstützt

Eigenschaften

Eingabetypscitype:transform-input
Series
Ausgabetypscitype:transform-output
Series
Label-Typscitype:transform-labels
None
Fit ist leerfit_is_empty
Ja
Behält den Zeitindextransform-returns-same-time-index
Nein
Benötigt Xrequires_X
Ja
Benötigt yrequires_y
Nein
X und y brauchen denselben IndexX-y-must-have-same-index
Nein

Parameter(4)

window_lengthint, optional (default=10)
Length of the sliding window
n_sigmaint, optional (default=3)
Defines how strong a point must outly to be an “outlier”
kfloat, optional (default = 1.4826)
A constant scale factor which is dependent on the distribution, for Gaussian it is approximately 1.4826, by default 1.4826
return_boolbool, optional (default=False)
If True, outliers are filled with True and non-outliers with False. Else, outliers are filled with np.nan.

Beispiele

>>> from sktime.transformations.outlier_detection import HampelFilter
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = HampelFilter (window_length = 10)
>>> y_hat = transformer. fit_transform (y)

Referenzen

[1]

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