-
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
[python] reset storage in record evaluation callback each time before starting training #4885
Conversation
@@ -319,6 +322,7 @@ def test_grid_search(): | |||
assert grid.best_estimator_.best_score_['valid_0']['error'] == 0 | |||
assert score >= 0.2 | |||
assert score <= 1. | |||
assert evals_result == grid.best_estimator_.evals_result_ |
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.
This assert fails at master
:
> assert evals_result == grid.best_estimator_.evals_result_
E AssertionError: assert {'valid_0': O..., 0, 0, 0])])} == {'valid_0': O... [0, 0, 0])])}
E Differing items:
E {'valid_0': OrderedDict([('multi_logloss', [0.5915701709051111, 0.5814219901209461, 0.6047065388140261, 0.555159764382..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])])} != {'valid_0': OrderedDict([('multi_logloss', [0.11975431959688579, 0.11424123104047454, 0.11872456319439122]), ('error', [0, 0, 0])])}
https://github.com/microsoft/LightGBM/runs/4499752025?check_suite_focus=true#step:3:834
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.
Makes sense to me!
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. |
Similarly to #4868.
Also, simplify early stopping callback by unconditionally reset all storages at the first iteration. This is much easier than tracking
inited
nonlocal flag (refer to #4868 (comment)).