"include/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "f7e64a8f5df7769de9a266b2257cea688e3c4925"
Unverified Commit f7e39388 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] remove support for '...' in predict() (#4857)

* [R-package] remove support for '...' in predict()

* restore ... in S3 method
parent 76fb0b62
......@@ -493,21 +493,10 @@ Booster <- R6::R6Class(
predcontrib = FALSE,
header = FALSE,
reshape = FALSE,
params = list(),
...) {
params = list()) {
self$restore_handle()
additional_params <- list(...)
if (length(additional_params) > 0L) {
warning(paste0(
"Booster$predict(): Found the following passed through '...': "
, paste(names(additional_params), collapse = ", ")
, ". These will be used, but in future releases of lightgbm, this warning will become an error. "
, "Add these to 'params' instead. See ?predict.lgb.Booster for documentation on how to call this function."
))
}
if (is.null(num_iteration)) {
num_iteration <- self$best_iter
}
......@@ -517,7 +506,6 @@ Booster <- R6::R6Class(
}
# Predict on new data
params <- utils::modifyList(params, additional_params)
predictor <- Predictor$new(
modelfile = private$handle
, params = params
......@@ -765,7 +753,7 @@ Booster <- R6::R6Class(
#' \href{https://lightgbm.readthedocs.io/en/latest/Parameters.html#predict-parameters}{
#' the "Predict Parameters" section of the documentation} for a list of parameters and
#' valid values.
#' @param ... Additional prediction parameters. NOTE: deprecated as of v3.3.0. Use \code{params} instead.
#' @param ... ignored
#' @return For regression or binary classification, it returns a vector of length \code{nrows(data)}.
#' For multiclass classification, either a \code{num_class * nrows(data)} vector or
#' a \code{(nrows(data), num_class)} dimension matrix is returned, depending on
......@@ -829,8 +817,7 @@ predict.lgb.Booster <- function(object,
warning(paste0(
"predict.lgb.Booster: Found the following passed through '...': "
, paste(names(additional_params), collapse = ", ")
, ". These will be used, but in future releases of lightgbm, this warning will become an error. "
, "Add these to 'params' instead. See ?predict.lgb.Booster for documentation on how to call this function."
, ". These are ignored. Use argument 'params' instead."
))
}
......@@ -844,7 +831,7 @@ predict.lgb.Booster <- function(object,
, predcontrib = predcontrib
, header = header
, reshape = reshape
, params = utils::modifyList(params, additional_params)
, params = params
)
)
}
......
......@@ -52,7 +52,7 @@ prediction outputs per case.}
the "Predict Parameters" section of the documentation} for a list of parameters and
valid values.}
\item{...}{Additional prediction parameters. NOTE: deprecated as of v3.3.0. Use \code{params} instead.}
\item{...}{ignored}
}
\value{
For regression or binary classification, it returns a vector of length \code{nrows(data)}.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment