Repository navigation
Conversation
jameslamb
left a comment
There was a problem hiding this comment.
Thanks. The fix makes sense but I'd like to see the tests made much stricter, and I've asked a clarifying question about one of them.
Please see my recommendations in #7459 (comment) for some ideas about what I mean by "much stricter".
| "max_depth": 1, | ||
| "learning_rate": 0.001, |
There was a problem hiding this comment.
| "max_depth": 1, | |
| "learning_rate": 0.001, |
I don't see a reason to override the default for learning_rate here, let's remove this.
And I think if you follow my other recommendations, you'll need to train deeper trees than max_depth: 1.
| def custom_l2(pred, data): | ||
| return pred - data.get_label(), np.ones_like(pred) | ||
|
|
||
| def reset_same_learning_rate(env): |
There was a problem hiding this comment.
Sorry but I am not understanding this... how is the learning rate involved in any of this? I don't understand what the reset_parameter tests are covering here.
There was a problem hiding this comment.
If the goal is just to set some parameter to a non-default value to be sure the initial SetConfig() call(s) do not exit early, that makes sense to me... but the tests aren't ever checking that learning_rate = 0.001 made it through into the Booster.
Either way, please do add some assertions here checking that other overrides (learning_rate is fine) do make it through into the Booster on the C++ side. The test code could call Booster._get_loaded_param() for help with that:
LightGBM/python-package/lightgbm/basic.py
Lines 3854 to 3866 in 9474d04
|
@jameslamb Thanks for your suggestions! |
Updating unrelated parameters triggers extra feature sampling, causing equivalent built-in and custom objectives to select different features. Skip resampling in
ColSampler::SetConfig()whenfeature_fractionandfeature_fraction_seedare unchanged.Fixes #6053.
I used an AI agent to help with the analysis, code, tests, and PR description. I reviewed the code and description.