MeanTransform

class MeanTransform(in_column: str, window: int, seasonality: int = 1, alpha: float = 1, min_periods: int = 1, fillna: float = 0, out_column: Optional[str] = None)[source]

Bases: etna.transforms.math.statistics.WindowStatisticsTransform

MeanTransform computes average value for given window.

\[MeanTransform(x_t) = \sum_{i=1}^{window}{x_{t - i}\cdot\alpha^{i - 1}}\]

Init MeanTransform.

Parameters
  • in_column (str) – name of processed column

  • window (int) – size of window to aggregate

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

  • alpha (float) – autoregressive coefficient

  • 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

  • out_column (str, optional) – result column name. If not given use self.__repr__()

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.

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

Get default grid for tuning hyperparameters.

This grid tunes parameters: window, alpha. Other parameters are expected to be set by the user.

Returns

Grid to tune.

Return type

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