Back to models
Forecaster

HyperTreeARForecaster

Categorical featuresIn-sample prediction intervalsExogenous variables

Hypertree-AR forecaster, from the hypertrees-forecasting package.

Direct interface to hypertrees.models.HyperTreeAR [1].

Hyper-Trees use a gradient boosted tree (LightGBM) to learn the parameters of a classical time series model as functions of features, rather than forecasting the series directly. HyperTreeAR targets a time-varying AR(p) model: the tree predicts the AR coefficients directly from the features at each time point, and the AR recursion generates the forecast. Unlike HyperTreeNetAR, no neural network is involved.

The interfaced estimator is univariate and models a single series.

Quickstart

python
from sktime.forecasting.hypertrees import HyperTreeARForecaster

estimator = HyperTreeARForecaster(p=2, hessian_method='analytic', n_hessian_probes=5, lgb_params=None, num_iterations=100, seed=123)

Tags

Capabilities

  • Categorical features
  • In-sample prediction intervals: Supported
  • Exogenous variables
  • In-sample predictions: Not supported
  • Prediction intervals: Not supported
  • Missing values: Not supported
  • Multivariate: Not supported

Properties

Needs forecast horizon in fitrequires-fh-in-fit
Yes
X and y need the same indexX-y-must-have-same-index
Yes

Parameters(6)

pint, optional (default=2)
Maximum number of AR(p) lags.
hessian_methodstr, optional (default=”analytic”)

Method for the Hessian diagonal, one of "exact", "analytic", or "gn". "analytic" uses closed-form gradients and Hessians, exploiting that the AR fit is linear in its parameters.

n_hessian_probesint, optional (default=5)

Number of Hutchinson probes, only used when hessian_method="gn".

lgb_paramsdict, optional (default=None)

LightGBM parameters. If None, {"learning_rate": 0.1} is used.

num_iterationsint, optional (default=100)
Number of boosting rounds.
seedint, optional (default=123)
Random seed for the interfaced estimator.

Examples

>>> from sktime.forecasting.hypertrees import HyperTreeARForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> forecaster = HyperTreeARForecaster (p = 2)
>>> forecaster. fit (y, fh = [1, 2, 3 ]) HyperTreeARForecaster(
... )
>>> y_pred = forecaster. predict ()

References

[1]

Maerz, Alexander, and Kashif Rasul. “Forecasting with Hyper-Trees.” arXiv preprint arXiv:2405.07836 (2024).