-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[python-package] ignore training set on early stopping callback (fixes #5354) #5412
Conversation
|
||
eval_records = {} | ||
callbacks = [ | ||
lgb.record_evaluation(eval_records), | ||
lgb.log_evaluation(2), | ||
lgb.early_stopping(4) | ||
lgb.early_stopping(10) |
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 changed this because otherwise it would stop at the 4th iteration, this was due to the training set being ignored for early stopping but now early stopping is disabled if you only provide the training set as valid, so I had to provide a dummy validation set.
@@ -1124,11 +1124,6 @@ def fit_and_check(eval_set_names, metric_names, assumed_iteration, first_metric_ | |||
iter_min = min([iter_min_l1, iter_min_l2]) | |||
iter_min_valid1 = min([iter_valid1_l1, iter_valid1_l2]) | |||
|
|||
# training data as eval_set |
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 think we shouldn't test this anymore but I'm open to modify it by adding an extra validation set so that we can check the training results
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.
Thank you!
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.
Tests and logic changes look good to me. Thanks for working on this!
Please see a few small suggestions.
Co-authored-by: James Lamb <jaylamb20@gmail.com>
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.
very nice, thanks for this!
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Fixes #5354