-
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-package] record_evaluation callback doesn't work with cv function #4943
Comments
Ah, I remember we had a similar problem in LightGBM/python-package/lightgbm/callback.py Lines 281 to 282 in 4aaeb22
LightGBM/python-package/lightgbm/callback.py Lines 322 to 329 in 4aaeb22
I believe we should preserve the nested structure of resulting dictionery in which we have dataset names at the first level and metric names at the second one, e.g.
|
I agree with preserving the structure but I think the |
Yeah, for sure! |
This issue 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. |
Description
The
record_evaluation
callback fails when trying to use it with thecv
function. Since some integrations that log metrics may use that callback to save the training information and thecv
function is very useful to do hyperparameter tuning I believe these two should work together.Reproducible example
This can be easily fixed by capturing the extra content from
env.evaluation_result_list
with*_
here:LightGBM/python-package/lightgbm/callback.py
Line 134 in 4aaeb22
LightGBM/python-package/lightgbm/callback.py
Line 141 in 4aaeb22
which would yield:
{'cv_agg': OrderedDict([('train l2', [0.06319766819578873, 0.06253713563921684]), ('valid l2', [0.06679350623951755, 0.06694167044391186])])}
Environment info
LightGBM version or commit hash: db045f4
Additional Comments
I'm happy to make the described changes if other maintainers agree with my solution.
The text was updated successfully, but these errors were encountered: