Supported Models

Scikit-hts extends the work done by Hyndman in a few ways. One of the most important ones is the ability to use a variety of different underlying modeling techniques to predict the base forecasts.

We have implemented so far 4 kinds of underlying models:

  1. Auto-Arima, thanks to the excellent implementation provided by the folks at alkaline-ml
  2. SARIMAX, implemented by the statsmodels package
  3. Holt-Winters exponential smoothing, also implemented in statsmodels
  4. Facebook’s Prophet

The full feature set of the underlying models is supported, including exogenous variables handling. Upon instantiation, use keyword arguments to pass the the arguments you need to the underlying model instantiation, fitting, and prediction.

Note

The main development focus is adding more support underlying models. Stay tuned, or feel free to check out the Contributing guide.

Models

class hts.model.AutoArimaModel(node: hts.hierarchy.HierarchyTree, **kwargs)[source]

Wrapper class around pmdarima.AutoARIMA

Variables:
  • model (pmdarima.AutoARIMA) – The instance of the model
  • mse (float) – MSE for in-sample predictions
  • residual (numpy.ndarry) – Residuals for the in-sample predictions
  • forecast (pandas.DataFramer) – The forecast for the trained model
fit(self, **fit_args)[source]

Fits underlying models to the data, passes kwargs to AutoARIMA

predict(self, node, steps_ahead: int = 10, alpha: float = 0.05)[source]

Predicts the n-step ahead forecast. Exogenous variables are required if models were fit using them

class hts.model.SarimaxModel(node: hts.hierarchy.HierarchyTree, **kwargs)[source]

Wrapper class around statsmodels.tsa.statespace.sarimax.SARIMAX

Variables:
  • model (SARIMAX) – The instance of the model
  • mse (float) – MSE for in-sample predictions
  • residual (numpy.ndarry) – Residuals for the in-sample predictions
  • forecast (pandas.DataFramer) – The forecast for the trained model
fit(self, **fit_args)[source]

Fits underlying models to the data, passes kwargs to SARIMAX

predict(self, node, steps_ahead: int = 10, alpha: float = 0.05)[source]

Predicts the n-step ahead forecast. Exogenous variables are required if models were fit using them

class hts.model.HoltWintersModel(node: hts.hierarchy.HierarchyTree, **kwargs)[source]

Wrapper class around statsmodels.tsa.holtwinters.ExponentialSmoothing

Variables:
  • model (ExponentialSmoothing) – The instance of the model
  • _model (HoltWintersResults) – The result of model fitting. See statsmodels.tsa.holtwinters.HoltWintersResults
  • mse (float) – MSE for in-sample predictions
  • residual (numpy.ndarry) – Residuals for the in-sample predictions
  • forecast (pandas.DataFramer) – The forecast for the trained model
fit(self, **fit_args)[source]

Fits underlying models to the data, passes kwargs to SARIMAX

predict(self, node, steps_ahead: int = 10)[source]

Predicts the n-step ahead forecast

class hts.model.FBProphetModel(node: hts.hierarchy.HierarchyTree, **kwargs)[source]

Wrapper class around fbprophet.Prophet

Variables:
  • model (Prophet) – The instance of the model
  • mse (float) – MSE for in-sample predictions
  • residual (numpy.ndarry) – Residuals for the in-sample predictions
  • forecast (pandas.DataFramer) – The forecast for the trained model
fit(self, **fit_args)[source]

Fits underlying models to the data, passes kwargs to fbprophet.Prophet

predict(self, node, steps_ahead: int = 10, freq: str = 'D', **predict_args)[source]

Predicts the n-step ahead forecast. Exogenous variables are required if models were fit using them, frequency should be passed as well