Back to models
Transformer

OptimalReconciler

Inverse transformUnequal-length series

Reconciliation for hierarchical time series.

Uses all the forecasts to obtain a reconciled forecast. Uses the constraint matrix approach, which is more efficient than the projection one.

If the dataframe is not hierarchical, this works as identity.

Quickstart

python
from sktime.transformations.hierarchical.reconcile import OptimalReconciler

estimator = OptimalReconciler(error_covariance_matrix: DataFrame=None, alpha=0)

Tags

Capabilities

  • Inverse transform: Supported
  • Unequal-length series
  • Multivariate: Not supported
  • Missing values: Not supported
  • Removes missing values: Not supported
  • Equalizes series length: Not supported

Properties

Input typescitype:transform-input
Series
Output typescitype:transform-output
Series
Label typescitype:transform-labels
None
Fit is emptyfit_is_empty
No
Keeps the time indextransform-returns-same-time-index
No
Requires Xrequires_X
Yes
Requires yrequires_y
No
X and y need the same indexX-y-must-have-same-index
No

Parameters(2)

error_covariance_matrixpd.DataFrame, default=None
Error covariance matrix. If None, it is assumed to be the identity matrix.
alphafloat, default=0
Constant added to the diagonal of the inverted matrix.

Examples

>>> from sktime.transformations.hierarchical.reconcile import (
... OptimalReconciler)
>>> from sktime.utils._testing.hierarchical import _make_hierarchical
>>> from sktime.forecasting.naive import NaiveForecaster
>>> y = _make_hierarchical ()
>>> pipe = OptimalReconciler () * NaiveForecaster ()
>>> pipe = pipe. fit (y)
>>> y_pred = pipe. predict (fh = [1, 2, 3 ])