-
Notifications
You must be signed in to change notification settings - Fork 917
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
Improvement/statsforecastets: make sf_ets probabilistic + add future_covariate support for sf_ets + add AutoTheta #1476
Improvement/statsforecastets: make sf_ets probabilistic + add future_covariate support for sf_ets + add AutoTheta #1476
Conversation
StatsForecastETS now is probabilistic in the same way as StatsForecas…
…the uncertainty because it doesn't take into account the uncertainty of the coef esimation of the OLS
…ded in sf_models.py.
Thanks @Beerstabr, that looks very good :) will have a look in detail soon. |
Codecov ReportBase: 94.08% // Head: 94.04% // Decreases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #1476 +/- ##
==========================================
- Coverage 94.08% 94.04% -0.05%
==========================================
Files 122 125 +3
Lines 10981 11056 +75
==========================================
+ Hits 10332 10398 +66
- Misses 649 658 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Many thanks @Beerstabr , that looks really good and we will definitely be able to include that in the next release of Darts :) I like the way future covariates are now handled.
I just have two fairly important things to ask:
- Could you please add unit tests for anything new that you've added (1-2 tests to make sure future covariates work as expected with ETS, and adding AutoTheta to the suite of tests)
- Could you split the models in separate files (I know i've initially suggested to regroup... but I have second thoughts because of the impact on the documentation...)
I also have a few other very minor comments, but nothing important.
@hrzn thanks for having a look! Will work on your request and comments. They all seem totally reasonable. |
Co-authored-by: Julien Herzen <[email protected]>
Co-authored-by: Julien Herzen <[email protected]>
…ents explaining the handling of future covariates by StatsForecastETS. Included StatsForecastTheta in the tests. Moved the utility functions that the statsforecast models share to a singly .py file. Added the CES model which is supposed to be probabilistic, but that doesn't work yet eventhough it is supposed to be included in statsforecast 1.4.0. Trying to figure out why it isn't working. Removed sf_models.py.
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.
Looks really good, only a few minor comments/questions left. Thanks @Beerstabr !
darts/tests/models/forecasting/test_local_forecasting_models.py
Outdated
Show resolved
Hide resolved
@@ -13,7 +13,7 @@ requests>=2.22.0 | |||
scikit-learn>=1.0.1 | |||
scipy>=1.3.2 | |||
shap>=0.40.0 | |||
statsforecast>=1.0.0 | |||
statsforecast>=1.4.0 |
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.
Are you sure this is the lowest possible version that supports everything?
I'm double checking because the higher our lower bounds, the more stringent a condition it puts on users who may have constraints on their Pypi settings.
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'm going to look into it for a bit more. I think it might depend on if we want AutoCES to be probabilistic as well. But let me check it and I'll come back to you with the options.
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.
@hrzn, I'm sure now that it is as follows:
- ETS (from statsforecast 1.3.2 onwards is called AutoETS) is available from 1.0.0, but only made probabilistic in 1.4.0
- AutoTheta became available in 1.3.0 and was probabilistic from the start
- AutoCES became available in 1.1.0 and is not yet probabilistic but will be -soon- in the next pip release (1.4.1/1.5.0?)
So if we don't choose 1.4.0 as a requirement, then we will have to drop the probabilistic nature of StatsForecastETS.
And we might want to rename StatsForecastETS to StatsForecastAutoETS, because it is also renamed by statsforecast.
What would you like me to put in there as a requirement? And do you want me to rename the ETS model?
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.
OK thanks a lot for investigating @Beerstabr .
We can keep 1.4.0 as the lower bound (and even update it once AutoCES is made probabilistic). I think that's OK because anyway all releases of statsforecast are quite recent.
I also think we should rename StatsForecastETS
to StatsForecastAutoETS
if they renamed it on their side.
Thanks!
…in statsforecast 1.4.0 - changed AutoETS to SFAutoETS - added models to the base tests - wrote two units tests for future covariates use for sf_ets
…in statsforecast 1.4.0 - changed AutoETS to SFAutoETS - added models to the base tests - wrote two units tests for future covariates use for sf_ets
@Beerstabr the only last thing left is to renamed the model to |
@hrzn yes, sorry forgot about it. Will change the name tonight! |
…babilistic' into improvement/statsforecastets_probabilistic
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.
Thanks a lot @Beerstabr ! This will go in the next release.
…covariate support for sf_ets + add AutoTheta (unit8co#1476) * StatsForecastETS now is probabilistic in the same way as StatsForecastAutoARIMA * include future covariates in sf_ets * sf_ets with future_covariates works.. probably it is underestimating the uncertainty because it doesn't take into account the uncertainty of the coef esimation of the OLS * Create separate file for StatsForecast models and extract some functions. * Added AutoTheta from the StatsForecast package. * Deleted sf_auto_arima.py and sf_ets.py, because the code is now included in sf_models.py. * Update darts/models/forecasting/sf_models.py Co-authored-by: Julien Herzen <[email protected]> * Update darts/models/forecasting/sf_models.py Co-authored-by: Julien Herzen <[email protected]> * Moved all statsforecast models to their own .py file. Added some comments explaining the handling of future covariates by StatsForecastETS. Included StatsForecastTheta in the tests. Moved the utility functions that the statsforecast models share to a singly .py file. Added the CES model which is supposed to be probabilistic, but that doesn't work yet eventhough it is supposed to be included in statsforecast 1.4.0. Trying to figure out why it isn't working. Removed sf_models.py. * Beginning of test for fit on residuals for statsforecast ets. * - AutoCES not probablisitc anymore, because that is not yet released in statsforecast 1.4.0 - changed AutoETS to SFAutoETS - added models to the base tests - wrote two units tests for future covariates use for sf_ets * - AutoCES not probablisitc anymore, because that is not yet released in statsforecast 1.4.0 - changed AutoETS to SFAutoETS - added models to the base tests - wrote two units tests for future covariates use for sf_ets * Changed StatsForecastETS to StatsForecastAutoETS. --------- Co-authored-by: Julien Herzen <[email protected]> Co-authored-by: Julien Herzen <[email protected]>
This is the first time I make contribution to a library like this, so please forgive me if I forgot to do something obvious!
Main changes:
Let me know if you'd like something implemented in a different way. Or if you'd like me to comment a bit more on the changes I've made.
I could also have included AutoCES from StatsForecast. Let me know if you want me to include that one too.