-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package] only warn about early stopping and DART boosting being incompatible if early stopping was requested #6619
Conversation
@microsoft-github-policy-service agree |
1f15014
to
0a15e38
Compare
* Issue: When using the 'dart'-booster, the lgb.cv()- and lgb.train()-function would trow a warning regardless of the specified model. See issue microsoft#6612 * Fix: The associated functions have been fixed by adding a nested if-statement that only triggers if the dart-booster is specified with early_stopping_rounds != NULL. * Unittests: The unit-test in test_parameters.R have been rewritten in the following way * The lightgbm()-test have had a expect_no_warning()-clause added if the model is correctly specified. * A new unittest have been created that checks wether lgb.cv() throws a warning errorneously. This commit closes microsoft#6612. 🔧
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 so much!
I've left some suggestions.
- I've changed the title of this.
- PR titles become changelog notes here, see for example https://github.com/microsoft/LightGBM/releases/tag/v4.5.0
- so the title should describe the change in a way that answers the question "what changed about LightGBM?", not "which files did this touch?"
- I've added "fixes [R-package] [BUG] Using
lgb.train()
withbooster = "dart"
gives warning regardless ofearly_stopping_rounds
value #6612" to the description - I've left some suggestions as comments directly on the diff. Please apply them directly in the browser, by clicking "Add to batch" and then commiting all of them.
Other notes
If you push additional commits, please don't force-push. All commits here are merged into 1 when a pull request is merged, so force-pushing is unnecessary.
In the future when you contribute here (or in any open source project on GitHub), don't use the target branch (in this case master
) on your fork. That makes it more difficult for maintainers to collaborate with you and makes it hard to keep your fork up to date with the upstream repo as it changes. Next time, create a separate branch on your fork, e.g. git checkout -b fix/r-dart-warning
.
regarding this comment: #6612 (comment)
I guess you're referring to https://github.com/microsoft/LightGBM/actions/runs/10455058311/job/28949296216?pr=6619? In the future, if you're referring to something we could observe by clicking links, please share those links in your comment. There (
Maybe the version of Alternatively, you could change from |
Co-authored-by: James Lamb <jaylamb20@gmail.com>
* expect_no_warning() can't be found on R 3.6.0, so an attempt with expect_silent() will be made.
* Added spaces after if-statements in lgb.cv() and lgb.train() * Reduced the character length of unittests to 120 characters
Hi @jameslamb, It took a while to finalize this The main difference from your initial review is that I have shortened the description on the unittests as {lintr} gave me an error on the line length. This can be seen in 2a866e8. I thought this would be an easy and fast fix, so I didn't consider creating a new branch. I am sorry for this - I will never do stuff on main anymore, I promise 🤞 And thank you so much for all your feedback on this PR. Best, |
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.
My only other suggestions after reviewing again were minor style things that are all personal preference, so I just pushed a commit directly changing those. We'll merge this once CI passes.
Thanks so much for the help! We appreciate the report and you being willing to come contribute. We'd be happy to have you come back and contribute again any time 😊
Fixes #6612
Fix: The associated functions have been fixed by adding a nested if-statement that only triggers if the dart-booster is specified with early_stopping_rounds != NULL.
Unittests: The unit-test in test_parameters.R have been rewritten in the following way
The lightgbm()-test have had a expect_no_warning()-clause added if the model is correctly specified.
A new unittest have been created that checks wether lgb.cv() throws a warning errorneously.
This commit closes #6612. 🔧