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 supports_multivariate property to ForecastingModel #1848

Merged
merged 12 commits into from Jul 5, 2023

Conversation

felixdivo
Copy link
Contributor

Fixes #1844.

Summary

The property was added to all models.

Other Information

I just assumed that this property then holds for all acpects of the time series, i.e. targets, covariates, ...

@felixdivo
Copy link
Contributor Author

CC @madtoinou

Copy link
Collaborator

@madtoinou madtoinou left a comment

Choose a reason for hiding this comment

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

Looking nice, thank you for also fixing the type hinting for some method.

In order to slightly simplify the code, would it be possible to define the property as returning True for the GlobalForecastingModels while keeping what you did for the LocalForecastingModels?

PS: it appears that you forgot to redefine the property for the FourTheta model in "theta.py"

darts/models/forecasting/block_rnn_model.py Show resolved Hide resolved
darts/models/forecasting/ensemble_model.py Show resolved Hide resolved
darts/models/forecasting/regression_ensemble_model.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2023

Codecov Report

Patch coverage: 69.90% and project coverage change: -0.23 ⚠️

Comparison is base (6d373f4) 94.16% compared to head (efc0344) 93.94%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1848      +/-   ##
==========================================
- Coverage   94.16%   93.94%   -0.23%     
==========================================
  Files         125      125              
  Lines       11642    11724      +82     
==========================================
+ Hits        10963    11014      +51     
- Misses        679      710      +31     
Impacted Files Coverage Δ
darts/models/forecasting/arima.py 91.48% <66.66%> (-1.70%) ⬇️
darts/models/forecasting/auto_arima.py 96.66% <66.66%> (-3.34%) ⬇️
darts/models/forecasting/baselines.py 96.29% <66.66%> (-3.71%) ⬇️
darts/models/forecasting/block_rnn_model.py 96.49% <66.66%> (-1.70%) ⬇️
darts/models/forecasting/croston.py 90.24% <66.66%> (-1.87%) ⬇️
darts/models/forecasting/dlinear.py 99.11% <66.66%> (-0.89%) ⬇️
darts/models/forecasting/ensemble_model.py 95.83% <66.66%> (-0.75%) ⬇️
darts/models/forecasting/exponential_smoothing.py 97.91% <66.66%> (-2.09%) ⬇️
darts/models/forecasting/fft.py 95.57% <66.66%> (-0.79%) ⬇️
darts/models/forecasting/kalman_forecaster.py 97.29% <66.66%> (-2.71%) ⬇️
... and 18 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@felixdivo
Copy link
Contributor Author

@madtoinou this should be done now.

Copy link
Collaborator

@madtoinou madtoinou left a comment

Choose a reason for hiding this comment

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

Looking good! Some minors comments before this is ready for merging.

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

@madtoinou madtoinou left a comment

Choose a reason for hiding this comment

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

Added suggestions for the docstrings of some RegressionModel, to make it more explicit that darts wrap around these models to make them multivariate when necessary.

On the contrary, RandomForest supports multivariate out of the box, same for XGBoost for example (so no need to mention anything in the docstring).

darts/models/forecasting/linear_regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/regression_model.py Show resolved Hide resolved
Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com>
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 really good @felixdivo , thanks a lot 🚀

Only had some minor comments:

  • Linting checks fail because of the added docstring for RegressionModels.
  • we can let RegressionModel handle the multivariate support and drop the properties in the sub classes

darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/random_forest.py Outdated Show resolved Hide resolved
darts/models/forecasting/linear_regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/lgbm.py Outdated Show resolved Hide resolved
darts/models/forecasting/catboost_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/xgboost.py Outdated Show resolved Hide resolved
felixdivo and others added 2 commits June 29, 2023 16:22
Uniform handling & documentation of supports_multivariate by RegressionModel class

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
@felixdivo
Copy link
Contributor Author

Done :)

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.

Perfect, thanks a lot @felixdivo 🚀 💯

@dennisbader dennisbader merged commit 4c3812b into unit8co:master Jul 5, 2023
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add supports_multivariate to ForecastingModel
4 participants