| xgb.params | R Documentation |
Convenience function to generate a list of named XGBoost parameters, which
can be passed as argument params to xgb.train(). See the online documentation for more details.
The purpose of this function is to enable IDE autocompletions and to provide in-package documentation for all the possible parameters that XGBoost accepts. The output from this function is just a regular R list containing the parameters that were set to non-default values. Note that this function will not perform any validation on the supplied arguments.
If passing NULL for a given parameter (the default for all of them), then the default
value for that parameter will be used. Default values are automatically determined by the
XGBoost core library upon calls to xgb.train() or xgb.cv(), and are subject to change
over XGBoost library versions. Some of them might differ according to the
booster type (e.g. defaults for regularization are different for linear and tree-based boosters).
xgb.params(
objective = NULL,
verbosity = NULL,
nthread = NULL,
seed = NULL,
booster = NULL,
eta = NULL,
learning_rate = NULL,
gamma = NULL,
min_split_loss = NULL,
max_depth = NULL,
min_child_weight = NULL,
max_delta_step = NULL,
subsample = NULL,
sampling_method = NULL,
colsample_bytree = NULL,
colsample_bylevel = NULL,
colsample_bynode = NULL,
lambda = NULL,
reg_lambda = NULL,
alpha = NULL,
reg_alpha = NULL,
tree_method = NULL,
scale_pos_weight = NULL,
updater = NULL,
refresh_leaf = NULL,
grow_policy = NULL,
max_leaves = NULL,
max_bin = NULL,
num_parallel_tree = NULL,
monotone_constraints = NULL,
interaction_constraints = NULL,
multi_strategy = NULL,
base_score = NULL,
eval_metric = NULL,
seed_per_iteration = NULL,
device = NULL,
disable_default_eval_metric = NULL,
use_rmm = NULL,
max_cached_hist_node = NULL,
extmem_single_page = NULL,
max_cat_to_onehot = NULL,
max_cat_threshold = NULL,
sample_type = NULL,
normalize_type = NULL,
rate_drop = NULL,
one_drop = NULL,
skip_drop = NULL,
feature_selector = NULL,
top_k = NULL,
num_class = NULL,
tweedie_variance_power = NULL,
huber_slope = NULL,
quantile_alpha = NULL,
aft_loss_distribution = NULL,
lambdarank_pair_method = NULL,
lambdarank_num_pair_per_sample = NULL,
lambdarank_normalization = NULL,
lambdarank_score_normalization = NULL,
lambdarank_unbiased = NULL,
lambdarank_bias_norm = NULL,
ndcg_exp_gain = NULL
)
objective |
(default= For custom objective, see Custom Objective and Evaluation Metric and Custom objective and metric for more information, along with the end note for function signatures. Supported values are:
|
verbosity |
(default=1) Verbosity of printing messages. Valid values are 0 (silent), 1 (warning), 2 (info), 3 (debug). Sometimes XGBoost tries to change configurations based on heuristics, which is displayed as warning message. If there's unexpected behaviour, please try to increase value of verbosity. |
nthread |
(default to maximum number of threads available if not set) Number of parallel threads used to run XGBoost. When choosing it, please keep thread contention and hyperthreading in mind. |
seed |
Random number seed. If not specified, will take a random seed through R's own RNG engine. |
booster |
(default= |
eta, learning_rate |
(two aliases for the same parameter)
Step size shrinkage used in update to prevent overfitting. After each boosting step, we can directly get the weights of new features, and
Note: should only pass one of |
gamma, min_split_loss |
(two aliases for the same parameter) (for Tree Booster) (default=0, alias: range: Note: should only pass one of |
max_depth |
(for Tree Booster) (default=6, type=int32)
Maximum depth of a tree. Increasing this value will make the model more complex and more likely to overfit. 0 indicates no limit on depth. Beware that XGBoost aggressively consumes memory when training a deep tree. range: |
min_child_weight |
(for Tree Booster) (default=1)
Minimum sum of instance weight (hessian) needed in a child. If the tree partition step results in a leaf node with the sum of instance weight less than range: |
max_delta_step |
(for Tree Booster) (default=0) Maximum delta step we allow each leaf output to be. If the value is set to 0, it means there is no constraint. If it is set to a positive value, it can help making the update step more conservative. Usually this parameter is not needed, but it might help in logistic regression when class is extremely imbalanced. Set it to value of 1-10 might help control the update. range: |
subsample |
(for Tree Booster) (default=1) Subsample ratio of the training instances. Setting it to 0.5 means that XGBoost would randomly sample half of the training data prior to growing trees. and this will prevent overfitting. Subsampling will occur once in every boosting iteration. range: |
sampling_method |
(for Tree Booster) (default=
|
colsample_bytree, colsample_bylevel, colsample_bynode |
(for Tree Booster) (default=1) This is a family of parameters for subsampling of columns.
One can set the |
lambda, reg_lambda |
(two aliases for the same parameter)
Note: should only pass one of |
alpha, reg_alpha |
(two aliases for the same parameter)
Note: should only pass one of |
tree_method |
(for Tree Booster) (default= Choices:
|
scale_pos_weight |
(for Tree Booster) (default=1)
Control the balance of positive and negative weights, useful for unbalanced classes. A typical value to consider: |
updater |
Has different meanings depending on the type of booster.
|
refresh_leaf |
(for Tree Booster) (default=1)
This is a parameter of the |
grow_policy |
(for Tree Booster) (default=
|
max_leaves |
(for Tree Booster) (default=0, type=int32)
Maximum number of nodes to be added. Not used by |
max_bin |
(for Tree Booster) (default=256, type=int32)
|
num_parallel_tree |
(for Tree Booster) (default=1) Number of parallel trees constructed during each iteration. This option is used to support boosted random forest. |
monotone_constraints |
(for Tree Booster) Constraint of variable monotonicity. See Monotonic Constraints for more information. |
interaction_constraints |
(for Tree Booster)
Constraints for interaction representing permitted interactions. The constraints must
be specified in the form of a nest list, e.g. |
multi_strategy |
(for Tree Booster) (default =
Version added: 2.0.0 Note: This parameter is working-in-progress. |
base_score |
|
eval_metric |
(default according to objective)
|
seed_per_iteration |
(default= |
device |
(default=
For more information about GPU acceleration, see XGBoost GPU Support. In distributed environments, ordinal selection is handled by distributed frameworks instead of XGBoost. As a result, using Version added: 2.0.0 Note: if XGBoost was installed from CRAN, it won't have GPU support enabled, thus only |
disable_default_eval_metric |
(default= |
use_rmm |
Whether to use RAPIDS Memory Manager (RMM) to allocate cache GPU
memory. The primary memory is always allocated on the RMM pool when XGBoost is built
(compiled) with the RMM plugin enabled. Valid values are |
max_cached_hist_node |
(for Non-Exact Tree Methods) (default = 65536)
Maximum number of cached nodes for histogram. This can be used with the Version added: 2.0.0
|
extmem_single_page |
(for Non-Exact Tree Methods) (default = Version added: 3.0.0 Whether the GPU-based |
max_cat_to_onehot |
(for Non-Exact Tree Methods) A threshold for deciding whether XGBoost should use one-hot encoding based split for categorical data. When number of categories is lesser than the threshold then one-hot encoding is chosen, otherwise the categories will be partitioned into children nodes. Version added: 1.6.0 |
max_cat_threshold |
(for Non-Exact Tree Methods) Maximum number of categories considered for each split. Used only by partition-based splits for preventing over-fitting. Version added: 1.7.0 |
sample_type |
(for Dart Booster) (default=
|
normalize_type |
(for Dart Booster) (default=
|
rate_drop |
(for Dart Booster) (default=0.0) Dropout rate (a fraction of previous trees to drop during the dropout). range: |
one_drop |
(for Dart Booster) (default=0) When this flag is enabled, at least one tree is always dropped during the dropout (allows Binomial-plus-one or epsilon-dropout from the original DART paper). |
skip_drop |
(for Dart Booster) (default=0.0) Probability of skipping the dropout procedure during a boosting iteration.
range: |
feature_selector |
(for Linear Booster) (default=
|
top_k |
(for Linear Booster) (default=0)
The number of top features to select in |
num_class |
Number of classes when using multi-class classification objectives (e.g. |
tweedie_variance_power |
(for Tweedie Regression (
|
huber_slope |
(for using Pseudo-Huber ( |
quantile_alpha |
(for using Quantile Loss ( Version added: 2.0.0 |
aft_loss_distribution |
(for using AFT Survival Loss ( |
lambdarank_pair_method |
(for learning to rank (
|
lambdarank_num_pair_per_sample |
(for learning to rank ( range = |
lambdarank_normalization |
(for learning to rank ( Version added: 2.1.0 |
lambdarank_score_normalization |
Whether to normalize the delta metric by the difference of prediction scores. This can sometimes stagnate the training progress. With pairwise ranking, we can normalize the gradient using the difference between two samples in each pair to reduce influence from the pairs that have large difference in ranking scores. This can help us regularize the model to reduce bias and prevent overfitting. Similar to other regularization techniques, this might prevent training from converging. There was no normalization before 2.0. In 2.0 and later versions this is used by default. In 3.0, we made this an option that users can disable. Version added: 3.0.0 |
lambdarank_unbiased |
(for learning to rank ( |
lambdarank_bias_norm |
(for learning to rank ( |
ndcg_exp_gain |
(for learning to rank ( |
A list with the entries that were passed non-NULL values. It is intended to
be passed as argument params to xgb.train() or xgb.cv().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.