Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Feb 19, 2025
1 parent 25af940 commit 4dd517b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R-package/R/callbacks.R
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ xgb.cb.early.stop <- function(
stop("For early stopping, 'evals' must have at least one element")
}
if (!inherits(model, "xgb.Booster") && save_best) {
stop("'save_best' must be set to FALSE for cv.")
stop("'save_best' must be set to FALSE when using early stopping in 'xgb.cv'.")
}
env$begin_iteration <- begin_iteration
return(NULL)
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/xgb.cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ xgb.cv <- function(params = xgb.params(), data, nrounds, nfold,
stop("'data' is an invalid 'xgb.DMatrix' object. Must be constructed again.")
}
if (inherits(data, "xgb.QuantileDMatrix")) {
stop("'xgb.QuantileDMatrix' is not yet supported for the cv function.")
stop("'xgb.QuantileDMatrix' is not supported as input to 'xgb.cv'.")
}

params <- check.booster.params(params)
Expand Down

0 comments on commit 4dd517b

Please sign in to comment.