Zurück zu den Modellen
Transformer

SeasonalDummiesOneHot

MultivariatFehlende WerteEntfernt fehlende Werte

Seasonal Dummy Features for time series seasonality.

A standard approach to capture seasonal effects is to add dummy exogenous variables, one for each season. e.g. for monthly seasonality add binary dummy variables Jan, Feb, …. For time ‘t’, these variables are set to 1 (resp 0) if ‘t’ occurs (resp does not occur) on that season. To avoid collinearity, one season is dropped when an intercept is also part of the model.

In the language of machine learning, the use of seasonal dummies is one hot encoding for the seasonal categorical variable.

Currently the following frequencies are supported: - Monthly: ‘M’ - Quarterly: ‘Q’ - Weekly: ‘W’ - Daily: ‘D’ - Hourly: ‘H’

Schnellstart

python
from sktime.transformations.dummies import SeasonalDummiesOneHot

estimator = SeasonalDummiesOneHot(sp: int | None=None, freq: str | None=None, drop: bool | None=True)

Tags

Fähigkeiten

  • Multivariat
  • Fehlende Werte
  • Entfernt fehlende Werte: Unterstützt
  • Inverse Transformation: Nicht unterstützt
  • Reihen ungleicher Länge: 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
Ja
Benötigt Xrequires_X
Ja
Benötigt yrequires_y
Nein
X und y brauchen denselben IndexX-y-must-have-same-index
Ja

Parameter(3)

spint, optional, default = None
Only used if the index of X (or y if X is None) passed to _transform() is a DatetimeIndex. The seasonal periodicity of the time series (e.g. 12 for monthly data). Can be omitted even in this case if freq is provided. (e.g. if index.freq is available, or freq=’M’)
freqstr, optional, default = None
Only used if the index of X (or y if X is None) passed to _transform() is a DatetimeIndex and sp is not provided. The frequency of the time series (e.g. ‘M’ for monthly data). Can be omitted even in this case if index.freq is available.
dropbool, default = True
Drop the first seasonal dummy? (Should be True if model contains an intercept)

Beispiele

>>> from sktime.transformations.dummies import SeasonalDummiesOneHot
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = SeasonalDummiesOneHot ()
>>> X = transformer. fit_transform (y = y, X = None)