From ea5ab13646947e67e0f35270456a9af9817da616 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 28 Aug 2021 16:14:05 -0500 Subject: [PATCH] fix silently-ignored parameter --- R-package/R/lgb.Booster.R | 2 +- R-package/R/lgb.Dataset.R | 5 ++++- R-package/man/lgb.Dataset.set.reference.Rd | 5 ++++- R-package/man/predict.lgb.Booster.Rd | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/R-package/R/lgb.Booster.R b/R-package/R/lgb.Booster.R index d53bb6ba97f8..586f3a38899d 100644 --- a/R-package/R/lgb.Booster.R +++ b/R-package/R/lgb.Booster.R @@ -759,7 +759,7 @@ Booster <- R6::R6Class( #' preds <- predict(model, test$data) #' #' # pass other prediction parameters -#' predict( +#' preds <- predict( #' model, #' test$data, #' params = list( diff --git a/R-package/R/lgb.Dataset.R b/R-package/R/lgb.Dataset.R index 0b9c7ba42a9a..5c7071ffafc9 100644 --- a/R-package/R/lgb.Dataset.R +++ b/R-package/R/lgb.Dataset.R @@ -1145,12 +1145,15 @@ lgb.Dataset.set.categorical <- function(dataset, categorical_feature) { #' #' @examples #' \donttest{ +#' # create training Dataset #' data(agaricus.train, package ="lightgbm") #' train <- agaricus.train #' dtrain <- lgb.Dataset(train$data, label = train$label) +#' +#' # create a validation Dataset, using dtrain as a reference #' data(agaricus.test, package = "lightgbm") #' test <- agaricus.test -#' dtest <- lgb.Dataset(test$data, test = train$label) +#' dtest <- lgb.Dataset(test$data, label = test$label) #' lgb.Dataset.set.reference(dtest, dtrain) #' } #' @rdname lgb.Dataset.set.reference diff --git a/R-package/man/lgb.Dataset.set.reference.Rd b/R-package/man/lgb.Dataset.set.reference.Rd index ee945b4c3bda..349b0b22913e 100644 --- a/R-package/man/lgb.Dataset.set.reference.Rd +++ b/R-package/man/lgb.Dataset.set.reference.Rd @@ -19,12 +19,15 @@ If you want to use validation data, you should set reference to training data } \examples{ \donttest{ +# create training Dataset data(agaricus.train, package ="lightgbm") train <- agaricus.train dtrain <- lgb.Dataset(train$data, label = train$label) + +# create a validation Dataset, using dtrain as a reference data(agaricus.test, package = "lightgbm") test <- agaricus.test -dtest <- lgb.Dataset(test$data, test = train$label) +dtest <- lgb.Dataset(test$data, label = test$label) lgb.Dataset.set.reference(dtest, dtrain) } } diff --git a/R-package/man/predict.lgb.Booster.Rd b/R-package/man/predict.lgb.Booster.Rd index 313d2dc7eb63..4bf875deddb6 100644 --- a/R-package/man/predict.lgb.Booster.Rd +++ b/R-package/man/predict.lgb.Booster.Rd @@ -90,7 +90,7 @@ model <- lgb.train( preds <- predict(model, test$data) # pass other prediction parameters -predict( +preds <- predict( model, test$data, params = list(