Skip to content

Commit

Permalink
move warning to error
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Feb 22, 2024
1 parent b7ca893 commit 9609b61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R-package/R/xgb.Booster.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ predict.xgb.Booster <- function(object, newdata, missing = NA, outputmargin = FA
}
is_dmatrix <- inherits(newdata, "xgb.DMatrix")
if (is_dmatrix && !is.null(base_margin)) {
warning("'base_margin' is ignored when passing 'xgb.DMatrix' as input.")
stop(
"'base_margin' is not supported when passing 'xgb.DMatrix' as input.",
" Should be passed as argument to 'xgb.DMatrix' constructor."
)
}

use_as_df <- FALSE
Expand Down

0 comments on commit 9609b61

Please sign in to comment.