HoltModel¶
- class HoltModel(exponential: bool = False, damped_trend: bool = False, initialization_method: str = 'estimated', initial_level: Optional[float] = None, initial_trend: Optional[float] = None, smoothing_level: Optional[float] = None, smoothing_trend: Optional[float] = None, damping_trend: Optional[float] = None, **fit_kwargs)[source]¶
Bases:
etna.models.holt_winters.HoltWintersModelHolt etna model.
Restricted version of HoltWinters model.
Notes
We use
statsmodels.tsa.holtwinters.ExponentialSmoothingmodel from statsmodels package. They implementstatsmodels.tsa.holtwinters.Holtmodel as a restricted version ofExponentialSmoothingmodel.Init Holt model with given params.
- Parameters
exponential (bool) –
Type of trend component. One of:
False: additive trend
True: multiplicative trend
damped_trend (bool) – Should the trend component be damped.
initialization_method (str) –
Method for initialize the recursions. One of:
None
’estimated’
’heuristic’
’legacy-heuristic’
’known’
None defaults to the pre-0.12 behavior where initial values are passed as part of
fit. If any of the other values are passed, then the initial values must also be set when constructing the model. If ‘known’ initialization is used, theninitial_levelmust be passed, as well asinitial_trendandinitial_seasonalif applicable. Default is ‘estimated’. “legacy-heuristic” uses the same values that were used in statsmodels 0.11 and earlier.initial_level (Optional[float]) – The initial level component. Required if estimation method is “known”. If set using either “estimated” or “heuristic” this value is used. This allows one or more of the initial values to be set while deferring to the heuristic for others or estimating the unset parameters.
initial_trend (Optional[float]) – The initial trend component. Required if estimation method is “known”. If set using either “estimated” or “heuristic” this value is used. This allows one or more of the initial values to be set while deferring to the heuristic for others or estimating the unset parameters.
smoothing_level (Optional[float]) – The alpha value of the simple exponential smoothing, if the value is set then this value will be used as the value.
smoothing_trend (Optional[float]) – The beta value of the Holt’s trend method, if the value is set then this value will be used as the value.
damping_trend (Optional[float]) – The phi value of the damped method, if the value is set then this value will be used as the value.
fit_kwargs – Additional parameters for calling
statsmodels.tsa.holtwinters.ExponentialSmoothing.fit().
- Inherited-members
Methods
fit(ts)Fit model.
forecast(ts)Make predictions.
get_model()Get internal models that are used inside etna class.
load(path)Load an object.
predict(ts)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.