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

[FEAT] Cross-temporal forecasting #309

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

elephaint
Copy link
Contributor

@elephaint elephaint commented Nov 27, 2024

First stab at (generic) temporal reconciliation. I've tried out a lot of stuff, but it seems for the moment it's easiest to implement using the strategy set out below.

Temporal reconciliation strategy

  • Aggregate temporally using aggregate_temporal, which is a minimal wrapper around aggregate, but in the temporal dimension, using a provided temporal spec
  • Reconcile using our current reconcilers

Thoughts

  • The simple implementation I'm currently suggesting becomes quite involved as it requires a lot of data wrangling and user interaction (see the added Example), so offering additional helper functions to users to get rid of that may be helpful
  • It may be beneficial as part of this PR to define a generic HierarchicalForecast class, with a.o. a .fit-method that consumes df, a cross-sectional and/or temporal spec, and a set of models linked to the spec. That would allow a user to only have to define (i) their spec, (ii) their models, (iii) their data, and run fit / forecast / cross-validation on the HierarchicalForecast class. Having fiddled with this over the last days there are a number of issues with this, a.o. that we need to generalize over the provided models in .fit (e.g. allowing models from SF, MF, NF), thus essentially building a Nixtla-class. Maybe that's a stretch for now.

Open issues

  • First example notebook doesn't work yet; main issue to solve is how the temporal unique ids can be matched back to the forecast df
  • Unit tests are missing
  • More examples (only temporal, temporal -> cross-sectional)

@elephaint elephaint linked an issue Nov 27, 2024 that may be closed by this pull request
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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

Successfully merging this pull request may close these issues.

Cross-termporal forecasting
1 participant