Skip to main content
The HierarchicalForecast package contains utility functions to wrangle and visualize hierarchical series datasets. The aggregate function of the module allows you to create a hierarchy from categorical variables representing the structure levels, returning also the aggregation contraints matrix S\mathbf{S}. In addition, HierarchicalForecast ensures compatibility of its reconciliation methods with other popular machine-learning libraries via its external forecast adapters that transform output base forecasts from external libraries into a compatible data frame format.

Aggregate Function

aggregate

Utils Aggregation Function. Aggregates bottom level series contained in the DataFrame df according to levels defined in the spec list. Parameters: Returns:

aggregate_temporal

Utils Aggregation Function for Temporal aggregations. Aggregates bottom level timesteps contained in the DataFrame df according to temporal levels defined in the spec list. Parameters: Returns:

make_future_dataframe

Create future dataframe for forecasting. Parameters: Returns:

get_cross_temporal_tags

Get cross-temporal tags. Parameters: Returns:

Hierarchical Visualization

HierarchicalPlot

Hierarchical Plot This class contains a collection of matplotlib visualization methods, suited for small to medium sized hierarchical series. Parameters:

HierarchicalPlot.plot_summing_matrix

Summation Constraints plot This method simply plots the hierarchical aggregation constraints matrix S\mathbf{S}. Returns:

HierarchicalPlot.plot_series

Single Series plot Parameters: Returns:

HierarchicalPlot.plot_hierarchically_linked_series

Hierarchically Linked Series plot Parameters: Returns:

HierarchicalPlot.plot_hierarchical_predictions_gap

Hierarchically Predictions Gap plot Parameters: Returns:

Example