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] Update deprecated and removed parameter lists for xgboost() #11151

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 23 additions & 0 deletions R-package/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,29 @@ deprecated_train_params <- list(
),
removed = character()
)
deprecated_xgboost_params <- list(
renamed = list(
'data' = 'x',
'label' = 'y',
'eta' = 'learning_rate',
'gamma' = 'min_split_loss',
'lambda' = 'reg_lambda',
'alpha' = 'reg_alpha',
'min.split.loss' = 'min_split_loss',
'reg.lambda' = 'reg_lambda',
'reg.alpha' = 'reg_alpha',
'watchlist' = 'evals'
),
removed = c(
'params',
'save_period',
'save_name',
'xgb_model',
'callbacks',
'missing',
'maximize'
)
)
deprecated_dttree_params <- list(
renamed = list('n_first_tree' = 'trees'),
removed = c("feature_names", "text")
Expand Down
5 changes: 4 additions & 1 deletion R-package/R/xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ check.early.stopping.rounds <- function(early_stopping_rounds, eval_set) {
#' - `"shotgun"`: Parallel coordinate descent algorithm based on shotgun algorithm. Uses 'hogwild' parallelism and therefore produces a nondeterministic solution on each run.
#' - `"coord_descent"`: Ordinary coordinate descent algorithm. Also multithreaded but still produces a deterministic solution. When the `device` parameter is set to `"cuda"` or `"gpu"`, a GPU variant would be used.
#' @inheritParams xgb.params
#' @inheritParams xgb.train
#' @return A model object, inheriting from both `xgboost` and `xgb.Booster`. Compared to the regular
#' `xgb.Booster` model class produced by [xgb.train()], this `xgboost` class will have an
#'
Expand Down Expand Up @@ -1140,9 +1141,11 @@ xgboost <- function(
tweedie_variance_power = NULL,
huber_slope = NULL,
quantile_alpha = NULL,
aft_loss_distribution = NULL
aft_loss_distribution = NULL,
...
) {
# nolint end
check.deprecation(deprecated_xgboost_params, match.call(), ...)
params <- as.list(environment())
params <- params[
(names(params) %in% formalArgs(xgb.params))
Expand Down
18 changes: 17 additions & 1 deletion R-package/man/xgboost.Rd

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

Loading