Repository navigation
Conversation
borchero
requested review from
StrikerRUS,
guolinke,
jameslamb,
jmoralez,
mayer79 and
shiyu1994
as code owners
May 15, 2026 15:19
borchero
commented
May 15, 2026
Comment on lines
+574
to
+576
| test_id = np.array_split(randidx, nfold) | ||
| train_id = [np.concatenate([test_id[i] for i in range(nfold) if k != i]) for k in range(nfold)] | ||
| folds = zip(train_id, test_id) | ||
| folds = zip(train_id, test_id, strict=True) |
Member
Author
There was a problem hiding this comment.
While, in all other places, this PR just adds strict=True, this uncovered an actual bug where we'd drop data if num_data is not divisible by nfold
| cv_res = lgb.cv(params, lgb_train, num_boost_round=20, nfold=3, stratified=False, return_cvbooster=True) | ||
| cv_booster = cv_res["cvbooster"].boosters | ||
| cv_mse_errors = [mean_squared_error(y, cb.predict(X)) < 463 for cb in cv_booster] | ||
| cv_mse_errors = [mean_squared_error(y, cb.predict(X)) < 504 for cb in cv_booster] |
Member
Author
There was a problem hiding this comment.
This needed to change as a result of the fix
Member
|
Hey cool that this uncovered a real bug! Thanks for this. I changed the label to |
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
Follow-up to #7276, see #7276 (comment).