Back to models
Forecaster

HyperTreeNetARForecaster

Categorical in XPred int insampleExogenous

Hyper-TreeNet-AR forecaster, from the hypertrees-forecasting package.

Direct interface to hypertrees.models.HyperTreeNetAR [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. HyperTreeNetAR targets a time-varying AR(p) model: the tree produces embeddings that a small neural network maps to the AR parameters, and the AR model generates the forecast.

The interfaced estimator is univariate and models a single series.

Quickstart

python
from sktime.forecasting.hypertrees import HyperTreeNetARForecaster

estimator = HyperTreeNetARForecaster(p=2, embedding_dimension=1, hidden_dim=128, dropout=0.1, use_random_projection=True, rp_embed_dim=12, network_learning_rate=0.001, gradient_mode='separate', device='cpu', hessian_method='exact', n_hessian_probes=5, lgb_params=None, num_iterations=100, seed=123)

Parameters(14)

pint, optional (default=2)
Maximum number of AR(p) lags.
embedding_dimensionint, optional (default=1)
Embedding dimension of the tree embeddings fed to the network.
hidden_dimint, optional (default=128)
Hidden dimension of the embedding network (MLP).
dropoutfloat, optional (default=0.1)
Dropout rate of the embedding network.
use_random_projectionbool, optional (default=True)
Whether to use random projections for the embeddings.
rp_embed_dimint, optional (default=12)

Dimension of the random projections, only used when use_random_projection=True.

network_learning_ratefloat, optional (default=1e-3)
Learning rate of the embedding network optimizer.
gradient_modestr, optional (default=”separate”)

Gradient computation mode, "separate" or "shared".

devicestr, optional (default=”cpu”)

Device for the embedding network, e.g. "cpu" or "cuda".

hessian_methodstr, optional (default=”exact”)

Method for the Hessian diagonal, "exact" or "gn".

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 HyperTreeNetARForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> forecaster = HyperTreeNetARForecaster (p = 2)
>>> forecaster. fit (y, fh = [1, 2, 3 ]) HyperTreeNetARForecaster(
... )
>>> y_pred = forecaster. predict ()

References

[1]

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