Add temporal hierarchies
Opened this issue · 2 comments
NasreddineD commented
Description
Hi,
I saw someone in the slack asking if there is a way to handle temporal hierarchies.
So I'm opening this feature request, if it can be done.
Thanks very much
Use case
For example, I have daily data, I would like to aggregate it weekly and monthly.
Forecast each temporal level and reconciliate.
jmoralez commented
Hey @NasreddineD. I believe you can do this by adding the columns and defining the spec, e.g.
df['month'] = df['ds'].dt.month.astype(str)
df['week'] = df['ds'].dt.isocalendar()['week'].astype(str)
spec = [['month', 'week']]
aggregate(df, spec)
NasreddineD commented
Hi @jmoralez,
My request was referring to this request (https://nixtlacommunity.slack.com/archives/C05CAFHU8TX/p1695115672015549?thread_ts=1695115672.015549&cid=C05CAFHU8TX)
Answered by @kdgutier
Thanks