Just a Temp Acc
07/30/2024, 3:46 PMTyler Blume
07/30/2024, 7:25 PMspec = [['business'],
['business', 'unique_id']
]
train_agg, S_train, tags = aggregate(df[['y','unique_id','ds','business']], spec)
Once you have that then just fit and predict for each train_agg index (the index should be the hierarchy bit).
You can tell where you are in the hierarchy based on the index and determine (either in a loop or custom function and group by) how to fit that series. After that you just need to format the output into train and fit dataframes to do normal reconciliation stuff with hierarchicalforecast.Just a Temp Acc
07/30/2024, 9:20 PM