[R] Reshape predictions for custom eval metric when they are 2D (#10323)
This commit is contained in:
@@ -213,7 +213,7 @@ xgb.iter.eval <- function(bst, evals, iter, feval) {
|
||||
res <- sapply(seq_along(evals), function(j) {
|
||||
w <- evals[[j]]
|
||||
## predict using all trees
|
||||
preds <- predict(bst, w, outputmargin = TRUE, iterationrange = "all")
|
||||
preds <- predict(bst, w, outputmargin = TRUE, reshape = TRUE, iterationrange = "all")
|
||||
eval_res <- feval(preds, w)
|
||||
out <- eval_res$value
|
||||
names(out) <- paste0(evnames[j], "-", eval_res$metric)
|
||||
|
||||
Reference in New Issue
Block a user