Skip to content

Commit

Permalink
[R-package] remove support for 'info' in Dataset (#4866)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Dec 7, 2021
1 parent fe535a0 commit 3ede5fa
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
20 changes: 1 addition & 19 deletions R-package/R/lgb.Dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#' \code{group = c(10, 20, 40, 10, 10, 10)}, that means that you have 6 groups,
#' where the first 10 records are in the first group, records 11-30 are in the
#' second group, etc.
#' @param info a list of information of the \code{lgb.Dataset} object. NOTE: use of \code{info}
#' is deprecated as of v3.3.0. Use keyword arguments (e.g. \code{init_score = init_score})
#' directly.
#' @keywords internal
NULL

Expand Down Expand Up @@ -52,7 +49,6 @@ Dataset <- R6::R6Class(
predictor = NULL,
free_raw_data = TRUE,
used_indices = NULL,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
Expand All @@ -66,14 +62,7 @@ Dataset <- R6::R6Class(
stop("lgb.Dataset: If provided, predictor must be a ", sQuote("lgb.Predictor"))
}

if (length(info) > 0L) {
warning(paste0(
"lgb.Dataset: found fields passed through 'info'. "
, "As of v3.3.0, this behavior is deprecated, and support for it will be removed in a future release. "
, "To suppress this warning, use keyword arguments 'label', 'weight', 'group', or 'init_score' directly"
))
}

info <- list()
if (!is.null(label)) {
info[["label"]] <- label
}
Expand Down Expand Up @@ -113,7 +102,6 @@ Dataset <- R6::R6Class(
},

create_valid = function(data,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
Expand Down Expand Up @@ -148,7 +136,6 @@ Dataset <- R6::R6Class(
, predictor = private$predictor
, free_raw_data = private$free_raw_data
, used_indices = NULL
, info = info
, label = label
, weight = weight
, group = group
Expand Down Expand Up @@ -599,7 +586,6 @@ Dataset <- R6::R6Class(
, predictor = private$predictor
, free_raw_data = private$free_raw_data
, used_indices = sort(idxset, decreasing = FALSE)
, info = NULL
, group = group
, init_score = init_score
, label = label
Expand Down Expand Up @@ -826,7 +812,6 @@ lgb.Dataset <- function(data,
colnames = NULL,
categorical_feature = NULL,
free_raw_data = TRUE,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
Expand Down Expand Up @@ -856,7 +841,6 @@ lgb.Dataset <- function(data,
, predictor = NULL
, free_raw_data = free_raw_data
, used_indices = NULL
, info = info
, label = label
, weight = weight
, group = group
Expand Down Expand Up @@ -932,7 +916,6 @@ lgb.Dataset <- function(data,
#' @export
lgb.Dataset.create.valid <- function(dataset,
data,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
Expand All @@ -958,7 +941,6 @@ lgb.Dataset.create.valid <- function(dataset,
return(invisible(
dataset$create_valid(
data = data
, info = info
, label = label
, weight = weight
, group = group
Expand Down
5 changes: 0 additions & 5 deletions R-package/man/lgb.Dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions R-package/man/lgb.Dataset.create.valid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions R-package/man/lgb_shared_dataset_params.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ede5fa

Please sign in to comment.