Zurück zu den Modellen
Transformer

AutoCorrelationTransformer

Auto-correlation transformer.

The autocorrelation function measures how correlated a timeseries is with itself at different lags. The AutocorrelationTransformer returns these values as a series for each lag up to the n_lags specified.

Schnellstart

python
from sktime.transformations.acf import AutoCorrelationTransformer

estimator = AutoCorrelationTransformer(adjusted=False, n_lags=None, fft=False, missing='none')

Tags

Fähigkeiten

  • Reihen ungleicher Länge
  • Multivariat: Nicht unterstützt
  • Inverse Transformation: Nicht unterstützt
  • Fehlende Werte: 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)

adjustedbool, default=False
If True, then denominators for autocovariance are n-k, otherwise n.
n_lagsint, default=None
Number of lags to return autocorrelation for. If None, statsmodels acf function uses min(10 * np.log10(nobs), nobs - 1).
fftbool, default=False
If True, computes the ACF via FFT.
missing{“none”, “raise”, “conservative”, “drop”}, default=”none”

How missing values are to be treated in autocorrelation function calculations.

  • “none” performs no checks or handling of missing values

  • “raise” raises an exception if NaN values are found.

  • “drop” removes the missing observations and then estimates the autocovariances treating the non-missing as contiguous.

  • “conservative” computes the autocovariance using nan-ops so that nans are removed when computing the mean and cross-products that are used to estimate the autocovariance. “n” in calculation is set to the number of non-missing observations.

Beispiele

>>> from sktime.transformations.acf import AutoCorrelationTransformer
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = AutoCorrelationTransformer (n_lags = 12)
>>> y_hat = transformer. fit_transform (y)