Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temporal hierarchies #241

Open
NasreddineD opened this issue Oct 7, 2023 · 2 comments
Open

Add temporal hierarchies #241

NasreddineD opened this issue Oct 7, 2023 · 2 comments

Comments

@NasreddineD
Copy link

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
Copy link
Member

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
Copy link
Author

NasreddineD commented Oct 11, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants