_SeasonalMovingAverageModel

class _SeasonalMovingAverageModel(window: int = 5, seasonality: int = 7)[source]

Bases: object

Seasonal moving average.

\[y_{t} = \frac{\sum_{i=1}^{n} y_{t-is} }{n},\]

where \(s\) is seasonality, \(n\) is window size (how many history values are taken for forecast).

Initialize seasonal moving average model.

Length of remembered tail of series is window * seasonality.

Parameters
  • window (int) – Number of values taken for forecast for each point.

  • seasonality (int) – Lag between values taken for forecast.

Inherited-members

Methods

fit(df, regressors)

Fit SeasonalMovingAverage model.

predict(df)

Compute predictions from a SeasonalMovingAverage model.

fit(df: pandas.core.frame.DataFrame, regressors: List[str]) etna.models.seasonal_ma._SeasonalMovingAverageModel[source]

Fit SeasonalMovingAverage model.

Parameters
  • df (pd.DataFrame) – Data to fit on

  • regressors (List[str]) – List of the columns with regressors(ignored in this model)

Returns

Fitted model

Return type

etna.models.seasonal_ma._SeasonalMovingAverageModel

predict(df: pandas.core.frame.DataFrame) numpy.ndarray[source]

Compute predictions from a SeasonalMovingAverage model.

Parameters

df (pd.DataFrame) – Used only for getting the horizon of forecast

Returns

Array with predictions.

Return type

numpy.ndarray