Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-package] Rename weight -> weights #4975

Merged
merged 5 commits into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions R-package/R/lightgbm.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ NULL
#' @description Simple interface for training a LightGBM model.
#' @inheritParams lgb_shared_params
#' @param label Vector of labels, used if \code{data} is not an \code{\link{lgb.Dataset}}
#' @param weight vector of response values. If not NULL, will set to dataset
#' @param weights Sample / observation weights for rows in the input data. If `NULL`, will assume that all
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
#' observations / rows have the same importance / weight.
#' @param save_name File name to use when writing the trained model to disk. Should end in ".model".
#' If passing `NULL`, will not save the trained model to disk.
#' @param ... Additional arguments passed to \code{\link{lgb.train}}. For example
Expand All @@ -114,7 +115,7 @@ NULL
#' @export
lightgbm <- function(data,
label = NULL,
weight = NULL,
weights = NULL,
params = list(),
nrounds = 100L,
verbose = 1L,
Expand All @@ -136,7 +137,7 @@ lightgbm <- function(data,

# Check whether data is lgb.Dataset, if not then create lgb.Dataset manually
if (!lgb.is.Dataset(x = dtrain)) {
dtrain <- lgb.Dataset(data = data, label = label, weight = weight)
dtrain <- lgb.Dataset(data = data, label = label, weight = weights)
}

train_args <- list(
Expand Down
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.