How to use covariates at different level for hierarchicalforecast? #346
Replies: 1 comment
-
I've only got 2 levels, and only one type of exogenous- variable for the different levels, but here's how I do it.
Here, exog_name (e.g. “Price”) repeats for each category Now lets focus on the target, Y_df
I can obtain the categories with some code and create a new column
From this, i simply merge, because now Y_df and df_exog has similar a column: category All that's left is the exog forecast that should also have the same unique_id's as Y_df as I've written above (1). I guess in your case, since you have different covariates, you could create a mapping between the unique_id from Y_df to your covariates and then proceed to merge. Hope this helps you somewhat, though we have different data. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, is there a way to incorporate covariates but at different levels of hierarchy? For example I have the following hierarchy:
spec = [
['Zone'],
['Zone', 'Market'],
['Zone', 'Market', 'Country'],
['Zone', 'Market', 'Country', 'Category'],
]
I have different covariates available at different level, for example price of a category, holidays of a country, inflation of a zone etc. Is there a way to incorporate them at different levels of the hierarchy?
Beta Was this translation helpful? Give feedback.
All reactions