Back to models
Transformer

Reconciler

Hierarchical reconciliation transformer.

Hierarchical reconciliation is a transformation which is used to make the predictions in a hierarchy of time-series sum together appropriately.

The methods implemented in this class only require the structure of the hierarchy or the forecasts values for reconciliation.

These functions are intended for transforming hierarchical forecasts, i.e. after prediction. However they are general and can be used to transform hierarchical time-series data.

For reconciliation methods that require historical values in addition to the forecasts, such as MinT, see the ReconcilerForecaster class.

For more versatile and efficient reconciliation in pipelines, see BottomUpReconciler, TopdownReconciler, OptimalReconciler, NonNegativeOptimalReconciler, MiddleOutReconciler, that apply reconciliation as preprocessing and postprocessing steps.

For further information on the methods, see [1].

Quickstart

python
from sktime.transformations.hierarchical.reconcile import Reconciler

estimator = Reconciler(method='bu')

Tags

Capabilities

  • Unequal-length series
  • Multivariate: Not supported
  • Inverse transform: 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
Yes
Requires Xrequires_X
Yes
Requires yrequires_y
No
X and y need the same indexX-y-must-have-same-index
No

Parameters(1)

method{“bu”, “ols”, “wls_str”, “td_fcst”}, default=”bu”

The reconciliation approach applied to the forecasts

  • "bu" - bottom-up

  • "ols" - ordinary least squares

  • "wls_str" - weighted least squares (structural)

  • "td_fcst" - top down based on (forecast) proportions

Examples

>>> from sktime.forecasting.trend import PolynomialTrendForecaster
>>> from sktime.transformations.hierarchical.reconcile import Reconciler
>>> from sktime.transformations.hierarchical.aggregate import Aggregator
>>> from sktime.utils._testing.hierarchical import _bottom_hier_datagen
>>> agg = Aggregator ()
>>> y = _bottom_hier_datagen (
... no_bottom_nodes = 3,
... no_levels = 1,
... random_seed = 123,
... )
>>> y = agg. fit_transform (y)
>>> forecaster = PolynomialTrendForecaster ()
>>> forecaster. fit (y) PolynomialTrendForecaster(
... )
>>> prds = forecaster. predict (fh = [1 ])
>>> # reconcile forecasts
>>> reconciler = Reconciler (method = "ols")
>>> prds_recon = reconciler. fit_transform (prds)

References