[R-package] remove support for 'info' in Dataset (#4866)

This commit is contained in:
James Lamb 2021-12-07 14:08:30 -06:00 коммит произвёл GitHub
Родитель fe535a0e9d
Коммит 3ede5fa24a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 1 добавлений и 33 удалений

Просмотреть файл

@ -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
@ -52,7 +49,6 @@ Dataset <- R6::R6Class(
predictor = NULL,
free_raw_data = TRUE,
used_indices = NULL,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
@ -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
}
@ -113,7 +102,6 @@ Dataset <- R6::R6Class(
},
create_valid = function(data,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
@ -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
@ -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
@ -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,
@ -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
@ -932,7 +916,6 @@ lgb.Dataset <- function(data,
#' @export
lgb.Dataset.create.valid <- function(dataset,
data,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
@ -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

Просмотреть файл

@ -11,7 +11,6 @@ lgb.Dataset(
colnames = NULL,
categorical_feature = NULL,
free_raw_data = TRUE,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
@ -45,10 +44,6 @@ 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
change the Dataset object after construction, set \code{free_raw_data = FALSE}.}
\item{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.}
\item{label}{vector of labels to use as the target variable}
\item{weight}{numeric vector of sample weights}

Просмотреть файл

@ -7,7 +7,6 @@
lgb.Dataset.create.valid(
dataset,
data,
info = list(),
label = NULL,
weight = NULL,
group = NULL,
@ -23,10 +22,6 @@ lgb.Dataset.create.valid(
a character representing a path to a text file (CSV, TSV, or LibSVM),
or a character representing a path to a binary \code{Dataset} file}
\item{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.}
\item{label}{vector of labels to use as the target variable}
\item{weight}{numeric vector of sample weights}

Просмотреть файл

@ -16,10 +16,6 @@ to be ranked. For example, if you have a 100-document dataset with
\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.}
\item{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.}
}
\description{
Parameter docs for fields used in \code{lgb.Dataset} construction