Unverified Commit ea87dd88 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] remove support for '...' in `lgb.Dataset()` (#4874)

parent de08d149
...@@ -776,7 +776,6 @@ Dataset <- R6::R6Class( ...@@ -776,7 +776,6 @@ Dataset <- R6::R6Class(
#' This reduces LightGBM's memory consumption, but it means that the Dataset object #' This reduces LightGBM's memory consumption, but it means that the Dataset object
#' cannot be changed after it has been constructed. If you'd prefer to be able to #' cannot be changed after it has been constructed. If you'd prefer to be able to
#' change the Dataset object after construction, set \code{free_raw_data = FALSE}. #' change the Dataset object after construction, set \code{free_raw_data = FALSE}.
#' @param ... other parameters passed to \code{params}
#' #'
#' @return constructed dataset #' @return constructed dataset
#' #'
...@@ -800,22 +799,8 @@ lgb.Dataset <- function(data, ...@@ -800,22 +799,8 @@ lgb.Dataset <- function(data,
label = NULL, label = NULL,
weight = NULL, weight = NULL,
group = NULL, group = NULL,
init_score = NULL, init_score = NULL) {
...) {
additional_params <- list(...)
params <- modifyList(params, additional_params)
if (length(additional_params) > 0L) {
warning(paste0(
"lgb.Dataset: 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 ?lgb.Dataset for documentation on how to call this function."
))
}
# Create new dataset
return( return(
invisible(Dataset$new( invisible(Dataset$new(
data = data data = data
......
...@@ -14,8 +14,7 @@ lgb.Dataset( ...@@ -14,8 +14,7 @@ lgb.Dataset(
label = NULL, label = NULL,
weight = NULL, weight = NULL,
group = NULL, group = NULL,
init_score = NULL, init_score = NULL
...
) )
} }
\arguments{ \arguments{
...@@ -56,8 +55,6 @@ where the first 10 records are in the first group, records 11-30 are in the ...@@ -56,8 +55,6 @@ where the first 10 records are in the first group, records 11-30 are in the
second group, etc.} second group, etc.}
\item{init_score}{initial score is the base prediction lightgbm will boost from} \item{init_score}{initial score is the base prediction lightgbm will boost from}
\item{...}{other parameters passed to \code{params}}
} }
\value{ \value{
constructed dataset constructed dataset
......
...@@ -2075,7 +2075,9 @@ test_that("lgb.train() works with linear learners and data where a feature has o ...@@ -2075,7 +2075,9 @@ test_that("lgb.train() works with linear learners and data where a feature has o
return(lgb.Dataset( return(lgb.Dataset(
data = X data = X
, label = 2L * X[, 1L] + runif(nrow(X), 0L, 0.1) , label = 2L * X[, 1L] + runif(nrow(X), 0L, 0.1)
, feature_pre_filter = FALSE , params = list(
feature_pre_filter = FALSE
)
)) ))
} }
......
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