DeseasonalityTransform

class DeseasonalityTransform(in_column: str, period: int, model: Literal['additive', 'multiplicative'] = 'additive')[source]

Bases: etna.transforms.base.ReversiblePerSegmentWrapper

Transform that uses statsmodels.tsa.seasonal.seasonal_decompose() to subtract seasonal component from the data.

Warning

This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.

Init DeseasonalityTransform.

Parameters
  • in_column (str) – name of processed column

  • period (int) – size of seasonality

  • model (Literal['additive', 'multiplicative']) – ‘additive’ (Y[t] = T[t] + S[t] + e[t], default option) or ‘multiplicative’ (Y[t] = T[t] * S[t] * e[t])

Inherited-members

Methods

fit(ts)

Fit the transform.

fit_transform(ts)

Fit and transform TSDataset.

get_regressors_info()

Return the list with regressors created by the transform.

inverse_transform(ts)

Inverse transform TSDataset.

load(path)

Load an object.

params_to_tune()

Get default grid for tuning hyperparameters.

save(path)

Save the object.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

transform(ts)

Transform TSDataset inplace.

get_regressors_info() List[str][source]

Return the list with regressors created by the transform.

Return type

List[str]

params_to_tune() Dict[str, etna.distributions.distributions.BaseDistribution][source]

Get default grid for tuning hyperparameters.

This grid tunes parameters: model. Other parameters are expected to be set by the user.

Returns

Grid to tune.

Return type

Dict[str, etna.distributions.distributions.BaseDistribution]