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/auto-regression and future values of past covariates documentation #2049

Merged
merged 12 commits into from
Nov 16, 2023

Conversation

madtoinou
Copy link
Collaborator

@madtoinou madtoinou commented Nov 3, 2023

Fixes #1822, fixes #2005.

Summary

  • Added a warning in GlobalForecastingModel.predict() (class where output_chunk is defined) when n > output_chunk_length and the model uses past covariates.
  • Added show_warnings parameter to hide the warning
  • Updated the docstring of output_chunk_length for the RegressionModels to mention auto-regression and the usage of the past covariates

Other Information

The covariates section of the User guide already contain the following passage :

There are some extra nuances that might be good to know. For instance, deep learning models in Darts can (in general) forecast output_chunk_length points at a time. However it is still possible for models trained with past covariates to make forecasts for some horizon n > output_chunk_length if the past_covariates are known far enough into the future. In such cases, the forecasts are obtained by consuming future values of the past covariates, and using auto-regression on the target series. If you want to know more details, read on.

Should it be more emphasized? Modified?

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a7f5d09) 93.82% compared to head (7d649dc) 93.85%.
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2049      +/-   ##
==========================================
+ Coverage   93.82%   93.85%   +0.03%     
==========================================
  Files         134      134              
  Lines       13091    13109      +18     
==========================================
+ Hits        12282    12303      +21     
+ Misses        809      806       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @madtoinou 🚀
As discussed, it would be nice if the warning is raised once only for historical forecasting, but if it's too tedious, we can leave it like that.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @madtoinou , looks good as well 🚀
Had some minor suggestions and we should probably merge the fit/predict_kwargs PR first.

darts/models/forecasting/catboost_model.py Outdated Show resolved Hide resolved
@@ -328,6 +328,7 @@ def _predict_wrapper(
num_samples: int,
verbose: bool = False,
predict_likelihood_parameters: bool = False,
show_warnings: bool = True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably merge the fit/predict kwargs for hist_fc before this PR and then adapt it here, right?

darts/models/forecasting/forecasting_model.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like regression models never call the super().predict() and this warning would never be raised when going through the optimized routine. Can we add this somehow?

madtoinou and others added 3 commits November 15, 2023 19:40
…d torch models, updated docstring about past/future covariates requirements in the torch models that were missing it
Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @madtoinou 🚀

I updated the docs a bit for torch and regression models to have a more unified style for input/output chunk length and covariates support

@dennisbader dennisbader merged commit 36a1c09 into master Nov 16, 2023
9 checks passed
@dennisbader dennisbader deleted the feat/doc_autoreg_pc branch November 16, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
3 participants