Skip to content

Commit

Permalink
fix weight and init_score assignment in lgb.cv (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgranvil authored and guolinke committed Nov 9, 2017
1 parent bc0579c commit 14a6d94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R-package/R/lgb.cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ lgb.cv <- function(params = list(),
if (!is.list(folds[[1]])) {
bst_folds <- lapply(seq_along(folds), function(k) {
dtest <- slice(data, folds[[k]])
dtrain <- slice(data, unlist(folds[-k]))
dtrain <- slice(data, seq_len(nrow(data))[-folds[[k]]])
setinfo(dtrain, "weight", getinfo(data, "weight")[-folds[[k]]])
setinfo(dtrain, "init_score", getinfo(data, "init_score")[-folds[[k]]])
setinfo(dtest, "weight", getinfo(data, "weight")[folds[[k]]])
Expand Down

0 comments on commit 14a6d94

Please sign in to comment.