Skip to content

Commit

Permalink
[R-package] stop automatically calculating eval metrics on training d…
Browse files Browse the repository at this point in the history
…ata in lightgbm() (#5209)

* [R-package] stop automatically calculating eval metrics on training data in lightgbm()

* update docs

* update docs

* roxygen cares about line breaks
  • Loading branch information
jameslamb authored May 18, 2022
1 parent 7d89ab4 commit 1617a63
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 69 deletions.
10 changes: 3 additions & 7 deletions R-package/R/lightgbm.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@
#' These should follow the requirements from the descriptions above.
#' }
#' }
#' @param eval_freq evaluation output frequency, only effect when verbose > 0
#' @param eval_freq evaluation output frequency, only effective when verbose > 0 and \code{valids} has been provided
#' @param init_model path of model file of \code{lgb.Booster} object, will continue training from this model
#' @param nrounds number of training rounds
#' @param obj objective function, can be character or custom objective function. Examples include
#' \code{regression}, \code{regression_l1}, \code{huber},
#' \code{binary}, \code{lambdarank}, \code{multiclass}, \code{multiclass}
#' @param params a list of parameters. See \href{https://lightgbm.readthedocs.io/en/latest/Parameters.html}{
#' the "Parameters" section of the documentation} for a list of parameters and valid values.
#' @param verbose verbosity for output, if <= 0, also will disable the print of evaluation during training
#' @param verbose verbosity for output, if <= 0 and \code{valids} has been provided, also will disable the
#' printing of evaluation during training
#' @param serializable whether to make the resulting objects serializable through functions such as
#' \code{save} or \code{saveRDS} (see section "Model serialization").
#' @section Early Stopping:
Expand Down Expand Up @@ -193,11 +194,6 @@ lightgbm <- function(data,
train_args[["valids"]] <- list()
}

# Set validation as oneself
if (params[["verbosity"]] > 0L) {
train_args[["valids"]][["train"]] <- dtrain
}

# Train a model using the regular way
bst <- do.call(
what = lgb.train
Expand Down
5 changes: 3 additions & 2 deletions R-package/man/lgb.cv.Rd

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

5 changes: 3 additions & 2 deletions R-package/man/lgb.train.Rd

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

5 changes: 3 additions & 2 deletions R-package/man/lgb_shared_params.Rd

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

5 changes: 3 additions & 2 deletions R-package/man/lightgbm.Rd

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

Loading

0 comments on commit 1617a63

Please sign in to comment.