[fix] lgbm 4.6.0 compatibility#207
Merged
HideakiImamura merged 7 commits intooptuna:mainfrom Feb 20, 2025
Merged
Conversation
Member
|
@HideakiImamura Could you review this PR? |
Member
HideakiImamura
left a comment
There was a problem hiding this comment.
Thanks for the PR. I have a minor comment. PTAL.
Comment on lines
+387
to
+390
| deprecated_arg_warning = ( | ||
| "Support for lgb.cv with argument {deprecated_arg} was removed from lightgbm 4.6.0 " | ||
| "and will not be supported by optuna in the future." | ||
| ) |
Member
There was a problem hiding this comment.
It would be great to add explanations in the docstring. Could you add them like this? The removed version will be v6.0.0.
Contributor
Author
There was a problem hiding this comment.
Please see 7a69be9. I'm assuming v4.2.2 will be the first release with the deprecation notice? Then removal slotted for v6.0.0
HideakiImamura
approved these changes
Feb 20, 2025
Member
HideakiImamura
left a comment
There was a problem hiding this comment.
Thanks for your swift actions! LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Makes two changes to let
optuna-integration[lightgbm]be compatible with the latest release of lightgbm, 4.6.0.Attempts to resolve issue 204
Here is a link to the diff between lightgbm 4.5.0 (works with optuna-integration[lightgbm]) and 4.6.0 (does not work).
The breaking changes are in these two PRs:
Description of the changes
feature_nameandcategorical_featurearguments tolgb.trainandlgb.cvwere removed in LightGBM #6706. So, makes those arguments default toNoneand only adds them tolgbm_kwargsin_LightGBMBaseTuner(and subsequent child classes) when they are explicitly provided. Adds a warning to the user that they should... not set these arguments. These should be removed in the future, but it's best to support backwards compatibility for folks still using lightgbm < 4.6.0._agg_cv_resultwas changed and the literalcv_aggwas removed. Therefore, we need to stop trying to match oncv_agginLightGBMPruningCallback._find_evaluation_resultto back out the correct cross validation metric set for early stopping callbacks.LightGBMPruningCallbackhere and could use help from maintainers (of this repo or LightGBM).