SeasonalMovingAverageModel¶
- class SeasonalMovingAverageModel(window: int = 5, seasonality: int = 7)[source]¶
Bases:
etna.models.mixins.PerSegmentModelMixin,etna.models.mixins.NonPredictionIntervalContextRequiredModelMixin,etna.models.base.NonPredictionIntervalContextRequiredAbstractModelSeasonal 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 the context 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(ts)Fit model.
forecast(ts, prediction_size)Make predictions.
Get internal model.
load(path)Load an object.
predict(ts, prediction_size)Make predictions with using true values as autoregression context if possible (teacher forcing).
save(path)Save the object.
to_dict()Collect all information about etna object in dict.
Attributes
Context size of the model.
- get_model() Dict[str, etna.models.seasonal_ma.SeasonalMovingAverageModel][source]¶
Get internal model.
- Returns
Internal model
- Return type
Dict[str, etna.models.seasonal_ma.SeasonalMovingAverageModel]
- property context_size: int¶
Context size of the model.