TopDownReconciliator

class TopDownReconciliator(target_level: str, source_level: str, period: int, method: str)[source]

Bases: etna.reconciliation.base.BaseReconciliator

Top-down reconciliation methods.

Notes

Top-down reconciliation methods support only non-negative data.

Create top-down reconciliator from source_level to target_level.

Parameters
  • target_level (str) – Level to be reconciled from the forecasts.

  • source_level (str) – Level to be forecasted.

  • period (int) – Period length for calculation reconciliation proportions.

  • method (str) –

    Proportions calculation method. Selects last period timestamps for estimation. Currently supported options:

    • AHP - Average historical proportions

    • PHA - Proportions of the historical averages

Inherited-members

Methods

aggregate(ts)

Aggregate the dataset to the source_level.

fit(ts)

Fit the reconciliator parameters.

reconcile(ts)

Reconcile the forecasts in the dataset.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

fit(ts: etna.datasets.tsdataset.TSDataset) etna.reconciliation.top_down.TopDownReconciliator[source]

Fit the reconciliator parameters.

Parameters

ts (etna.datasets.tsdataset.TSDataset) – TSDataset on the level which is lower or equal to target_level, source_level.

Returns

Fitted instance of reconciliator.

Return type

etna.reconciliation.top_down.TopDownReconciliator