-
Notifications
You must be signed in to change notification settings - Fork 912
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
fix the sample_weights bug #2445
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2445 +/- ##
==========================================
- Coverage 93.80% 93.80% -0.01%
==========================================
Files 139 139
Lines 14680 14678 -2
==========================================
- Hits 13771 13768 -3
- Misses 909 910 +1 ☔ View full report in Codecov by Sentry. |
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 for the fix and the contribution @cnhwl 🚀 It's highly appreciated :)
I just had a minor suggestion for code. And there are some things that we should address before merging:
- add a unit test to
darts/tests/models/forecasting/test_regression_models.py
that checks that it works as expected with models that don't support sample weights - in
darts/utils/multioutput.py
-MultiOutputRegressor.fit()
we currently raise an error if the user providedsample_weight
but the model doesn't support it. The MultiOutputRegressor is applied if we need to predict more than one target component and / or output_chunk_length > 1. Ideally, we should have the same behavior there as well. So if you can replace raising an error with a warning, that should be fine. (these lines here) - can you add an etry to our CHANGELOG.md under the Unreleased / Fixed section?
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 for the updates @cnhwl 🚀
I took the liberty to apply the last open points directly (e.g., adaptions to MultiOutputRegressor, and adding the KNeighborsRegressor only to the sample weights tests).
Looks great now! We can merge after all tests have passed 💯
Thank you so much! @dennisbader ❤️ I have benefited a lot from your code. It's been a pleasure working with you on this merge. Looking forward to contributing more to the darts library! 🚀 |
Checklist before merging this PR:
Fixes #2439.
Summary
fixes the sample_weights bug by making conditional judgement on whether sample_weights is none and whether the parameter sample_weights exists in the model fit method.