WindowStatisticsTransform

class WindowStatisticsTransform(in_column: str, out_column: str, window: int, seasonality: int = 1, min_periods: int = 1, fillna: float = 0, **kwargs)[source]

Bases: etna.transforms.base.IrreversibleTransform, abc.ABC

WindowStatisticsTransform handles computation of statistical features on windows.

Init WindowStatisticsTransform.

Parameters
  • in_column (str) – name of processed column

  • out_column (str) – result column name

  • window (int) – size of window to aggregate, if -1 is set all history is used

  • seasonality (int) – seasonality of lags to compute window’s aggregation with

  • min_periods (int) – min number of targets in window to compute aggregation; if there is less than min_periods number of targets return None

  • fillna (float) – value to fill results NaNs with

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.

fit(ts: etna.datasets.tsdataset.TSDataset) etna.transforms.math.statistics.WindowStatisticsTransform[source]

Fit the transform.

Parameters

ts (etna.datasets.tsdataset.TSDataset) –

Return type

etna.transforms.math.statistics.WindowStatisticsTransform

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 only window parameter. Other parameters are expected to be set by the user.

Returns

Grid to tune.

Return type

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