-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FEAT] Cross-temporal forecasting #309
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Not quite yet. The aggregated ids are sorted lexicographically, which messes up the assignment of the dates |
Fixed by maintaining order throughout the aggregation. Issues remaining:
|
Assignment of bottom dates to aggregated levels by assigning the observed unique timestamps in a linspace where the step is determined by the number of steps in the temporal aggregation. Also not ideal, but best for the moment. |
id_col: str = "unique_id", | ||
time_col: str = "ds", | ||
id_time_col: str = "temporal_id", | ||
target_cols: list[str] = ["y"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make this immutable, e.g.
from collections.abc import Sequence
...
target_cols: Sequence[str] = ("y",), # one-tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work when we have multiple targets? (which is the reason it's a list)
Temporal reconciliation strategy
aggregate_temporal
, which is a minimal wrapper aroundaggregate
, but in the temporal dimension, using a provided temporalspec
See the two new examples that showcase temporal reconciliation.
Limitations
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 dfExample works!Include an easier evaluate function for cross-temporal forecasts, it now requires to run a somewhat complex itertools double for-loop.aggregate_temporal
make_future_dataframe
ufe.time_features cannot handle non-timestamp ds columnsInput should be timestamp or integer