MovingAverageModel¶
- class MovingAverageModel(window: int = 5)[source]¶
Bases:
etna.models.seasonal_ma.SeasonalMovingAverageModelMovingAverageModel averages previous series values to forecast future one.
\[y_{t} = \frac{\sum_{i=1}^{n} y_{t-i} }{n},\]where \(n\) is window size.
Init MovingAverageModel.
- Parameters
window (int) – number of history points to average
- Inherited-members
Methods
fit(ts)Fit model.
forecast(ts, prediction_size)Make predictions.
get_model()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_sizeContext size of the model.