Debian Codegraph @

man/xgb.params.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/xgb.train.R
3 \name{xgb.params}
4 \alias{xgb.params}
5 \title{XGBoost Parameters}
6 \usage{
7 xgb.params(
8 objective = NULL,
9 verbosity = NULL,
10 nthread = NULL,
11 seed = NULL,
12 booster = NULL,
13 eta = NULL,
14 learning_rate = NULL,
15 gamma = NULL,
16 min_split_loss = NULL,
17 max_depth = NULL,
18 min_child_weight = NULL,
19 max_delta_step = NULL,
20 subsample = NULL,
21 sampling_method = NULL,
22 colsample_bytree = NULL,
23 colsample_bylevel = NULL,
24 colsample_bynode = NULL,
25 lambda = NULL,
26 reg_lambda = NULL,
27 alpha = NULL,
28 reg_alpha = NULL,
29 tree_method = NULL,
30 scale_pos_weight = NULL,
31 updater = NULL,
32 refresh_leaf = NULL,
33 grow_policy = NULL,
34 max_leaves = NULL,
35 max_bin = NULL,
36 num_parallel_tree = NULL,
37 monotone_constraints = NULL,
38 interaction_constraints = NULL,
39 multi_strategy = NULL,
40 base_score = NULL,
41 eval_metric = NULL,
42 seed_per_iteration = NULL,
43 device = NULL,
44 disable_default_eval_metric = NULL,
45 use_rmm = NULL,
46 max_cached_hist_node = NULL,
47 max_cat_to_onehot = NULL,
48 max_cat_threshold = NULL,
49 sample_type = NULL,
50 normalize_type = NULL,
51 rate_drop = NULL,
52 one_drop = NULL,
53 skip_drop = NULL,
54 feature_selector = NULL,
55 top_k = NULL,
56 num_class = NULL,
57 tweedie_variance_power = NULL,
58 huber_slope = NULL,
59 quantile_alpha = NULL,
60 aft_loss_distribution = NULL,
61 aft_loss_distribution_scale = NULL,
62 lambdarank_pair_method = NULL,
63 lambdarank_num_pair_per_sample = NULL,
64 lambdarank_normalization = NULL,
65 lambdarank_score_normalization = NULL,
66 lambdarank_unbiased = NULL,
67 lambdarank_bias_norm = NULL,
68 ndcg_exp_gain = NULL
69 )
70 }
71 \arguments{
72 \item{objective}{(default=\code{"reg:squarederror"})
73 Specify the learning task and the corresponding learning objective or a custom objective function to be used.
74
75 For custom objective, see \href{https://xgboost.readthedocs.io/en/latest/tutorials/custom_metric_obj.html}{Custom Objective and Evaluation Metric}
76 and \href{https://xgboost.readthedocs.io/en/latest/tutorials/saving_model.html#custom-obj-metric}{Custom objective and metric} for more information,
77 along with the end note for function signatures.
78
79 Supported values are:
80 \itemize{
81 \item \code{"reg:squarederror"}: regression with squared loss.
82 \item \code{"reg:squaredlogerror"}: regression with squared log loss \eqn{\frac{1}{2}[log(pred + 1) - log(label + 1)]^2}. All input labels are required to be greater than -1. Also, see metric \code{rmsle} for possible issue with this objective.
83 \item \code{"reg:logistic"}: logistic regression, output probability
84 \item \code{"reg:pseudohubererror"}: regression with Pseudo Huber loss, a twice differentiable alternative to absolute loss.
85 \item \code{"reg:absoluteerror"}: Regression with L1 error. When tree model is used, leaf value is refreshed after tree construction. If used in distributed training, the leaf value is calculated as the mean value from all workers, which is not guaranteed to be optimal.
86
87 Version added: 1.7.0
88 \item \code{"reg:quantileerror"}: Quantile loss, also known as "pinball loss". See later sections for its parameter and \href{https://xgboost.readthedocs.io/en/latest/python/examples/quantile_regression.html#sphx-glr-python-examples-quantile-regression-py}{Quantile Regression} for a worked example.
89
90 Version added: 2.0.0
91 \item \code{"binary:logistic"}: logistic regression for binary classification, output probability
92 \item \code{"binary:logitraw"}: logistic regression for binary classification, output score before logistic transformation
93 \item \code{"binary:hinge"}: hinge loss for binary classification. This makes predictions of 0 or 1, rather than producing probabilities.
94 \item \code{"count:poisson"}: Poisson regression for count data, output mean of Poisson distribution.
95 \code{"max_delta_step"} is set to 0.7 by default in Poisson regression (used to safeguard optimization)
96 \item \code{"survival:cox"}: Cox regression for right censored survival time data (negative values are considered right censored).
97
98 Note that predictions are returned on the hazard ratio scale (i.e., as HR = exp(marginal_prediction) in the proportional hazard function \code{h(t) = h0(t) * HR}).
99 \item \code{"survival:aft"}: Accelerated failure time model for censored survival time data.
100 See \href{https://xgboost.readthedocs.io/en/latest/tutorials/aft_survival_analysis.html}{Survival Analysis with Accelerated Failure Time} for details.
101 \item \code{"multi:softmax"}: set XGBoost to do multiclass classification using the softmax objective, you also need to set num_class(number of classes)
102 \item \code{"multi:softprob"}: same as softmax, but output a vector of \code{ndata * nclass}, which can be further reshaped to \code{ndata * nclass} matrix. The result contains predicted probability of each data point belonging to each class.
103 \item \code{"rank:ndcg"}: Use LambdaMART to perform pair-wise ranking where the normalized discounted cumulative gain (NDCG) is maximized. This objective supports position debiasing for click data.
104 \item \code{"rank:map"}: Use LambdaMART to perform pair-wise ranking where the mean average precision (MAP) is maximized
105 \item \code{"rank:pairwise"}: Use LambdaRank to perform pair-wise ranking using the \code{ranknet} objective.
106 \item \code{"reg:gamma"}: gamma regression with log-link. Output is a mean of gamma distribution. It might be useful, e.g., for modeling insurance claims severity, or for any outcome that might be gamma-distributed.
107 \item \code{"reg:tweedie"}: Tweedie regression with log-link. It might be useful, e.g., for modeling total loss in insurance, or for any outcome that might be tweedie-distributed.
108 }}
109
110 \item{verbosity}{(default=1)
111 Verbosity of printing messages. Valid values are 0 (silent), 1 (warning), 2 (info), 3
112 (debug). Sometimes XGBoost tries to change configurations based on heuristics, which
113 is displayed as warning message. If there's unexpected behaviour, please try to
114 increase value of verbosity.}
115
116 \item{nthread}{(default to maximum number of threads available if not set)
117 Number of parallel threads used to run XGBoost. When choosing it, please keep thread
118 contention and hyperthreading in mind.}
119
120 \item{seed}{Random number seed. If not specified, will take a random seed through R's own RNG engine.}
121
122 \item{booster}{(default= \code{"gbtree"})
123 Which booster to use. Can be \code{"gbtree"}, \code{"gblinear"} or \code{"dart"}; \code{"gbtree"} and \code{"dart"} use tree based models while \code{"gblinear"} uses linear functions.}
124
125 \item{eta, learning_rate}{(two aliases for the same parameter)
126 Step size shrinkage used in update to prevent overfitting. After each boosting step, we can directly get the weights of new features, and \code{eta} shrinks the feature weights to make the boosting process more conservative.
127 \itemize{
128 \item range: \eqn{[0,1]}
129 \item default value: 0.3 for tree-based boosters, 0.5 for linear booster.
130 }
131
132 Note: should only pass one of \code{eta} or \code{learning_rate}. Both refer to the same parameter and there's thus no difference between one or the other.}
133
134 \item{gamma, min_split_loss}{(two aliases for the same parameter) (for Tree Booster) (default=0, alias: \code{gamma})
135 Minimum loss reduction required to make a further partition on a leaf node of the tree. The larger \code{min_split_loss} is, the more conservative the algorithm will be. Note that a tree where no splits were made might still contain a single terminal node with a non-zero score.
136
137 range: \eqn{[0, \infty)}
138
139 Note: should only pass one of \code{gamma} or \code{min_split_loss}. Both refer to the same parameter and there's thus no difference between one or the other.}
140
141 \item{max_depth}{(for Tree Booster) (default=6, type=int32)
142 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. \code{"exact"} tree method requires non-zero value.
143
144 range: \eqn{[0, \infty)}}
145
146 \item{min_child_weight}{(for Tree Booster) (default=1)
147 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 \code{min_child_weight}, then the building process will give up further partitioning. In linear regression task, this simply corresponds to minimum number of instances needed to be in each node. The larger \code{min_child_weight} is, the more conservative the algorithm will be.
148
149 range: \eqn{[0, \infty)}}
150
151 \item{max_delta_step}{(for Tree Booster) (default=0)
152 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.
153
154 range: \eqn{[0, \infty)}}
155
156 \item{subsample}{(for Tree Booster) (default=1)
157 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.
158
159 range: \eqn{(0,1]}}
160
161 \item{sampling_method}{(for Tree Booster) (default= \code{"uniform"})
162 The method to use to sample the training instances.
163 \itemize{
164 \item \code{"uniform"}: each training instance has an equal probability of being selected. Typically set
165 \code{"subsample"} >= 0.5 for good results.
166 \item \code{"gradient_based"}: the selection probability for each training instance is proportional to the
167 \bold{regularized absolute value} of gradients (more specifically, \eqn{\sqrt{g^2+\lambda h^2}}).
168 \code{"subsample"} may be set to as low as 0.1 without loss of model accuracy. Note that this
169 sampling method is only supported when \code{"tree_method"} is set to \code{"hist"}; other tree
170 methods only support \code{"uniform"} sampling.
171 }}
172
173 \item{colsample_bytree, colsample_bylevel, colsample_bynode}{(for Tree Booster) (default=1)
174 This is a family of parameters for subsampling of columns.
175 \itemize{
176 \item All \code{"colsample_by*"} parameters have a range of \eqn{(0, 1]}, the default value of 1, and specify the fraction of columns to be subsampled.
177 \item \code{"colsample_bytree"} is the subsample ratio of columns when constructing each tree. Subsampling occurs once for every tree constructed.
178 \item \code{"colsample_bylevel"} is the subsample ratio of columns for each level. Subsampling occurs once for every new depth level reached in a tree. Columns are subsampled from the set of columns chosen for the current tree.
179 \item \code{"colsample_bynode"} is the subsample ratio of columns for each node (split). Subsampling occurs once every time a new split is evaluated. Columns are subsampled from the set of columns chosen for the current level. This is not supported by the exact tree method.
180 \item \code{"colsample_by*"} parameters work cumulatively. For instance,
181 the combination \verb{\{'colsample_bytree'=0.5, 'colsample_bylevel'=0.5, 'colsample_bynode'=0.5\}} with 64 features will leave 8 features to choose from at
182 each split.
183 }
184
185 One can set the \code{"feature_weights"} for DMatrix to
186 define the probability of each feature being selected when using column sampling.}
187
188 \item{lambda, reg_lambda}{(two aliases for the same parameter)
189 \itemize{
190 \item For tree-based boosters:
191 \itemize{
192 \item L2 regularization term on weights. Increasing this value will make model more conservative.
193 \item default: 1
194 \item range: \eqn{[0, \infty]}
195 }
196 \item For linear booster:
197 \itemize{
198 \item L2 regularization term on weights. Increasing this value will make model more conservative. Normalised to number of training examples.
199 \item default: 0
200 \item range: \eqn{[0, \infty)}
201 }
202 }
203
204 Note: should only pass one of \code{lambda} or \code{reg_lambda}. Both refer to the same parameter and there's thus no difference between one or the other.}
205
206 \item{alpha, reg_alpha}{(two aliases for the same parameter)
207 \itemize{
208 \item L1 regularization term on weights. Increasing this value will make model more conservative.
209 \item For the linear booster, it's normalised to number of training examples.
210 \item default: 0
211 \item range: \eqn{[0, \infty)}
212 }
213
214 Note: should only pass one of \code{alpha} or \code{reg_alpha}. Both refer to the same parameter and there's thus no difference between one or the other.}
215
216 \item{tree_method}{(for Tree Booster) (default= \code{"auto"})
217 The tree construction algorithm used in XGBoost. See description in the \href{https://arxiv.org/abs/1603.02754}{reference paper} and \href{https://xgboost.readthedocs.io/en/latest/treemethod.html}{Tree Methods}.
218
219 Choices: \code{"auto"}, \code{"exact"}, \code{"approx"}, \code{"hist"}, this is a combination of commonly
220 used updaters. For other updaters like \code{"refresh"}, set the parameter \code{updater}
221 directly.
222 \itemize{
223 \item \code{"auto"}: Same as the \code{"hist"} tree method.
224 \item \code{"exact"}: Exact greedy algorithm. Enumerates all split candidates.
225 \item \code{"approx"}: Approximate greedy algorithm using quantile sketch and gradient histogram.
226 \item \code{"hist"}: Faster histogram optimized approximate greedy algorithm.
227 }}
228
229 \item{scale_pos_weight}{(for Tree Booster) (default=1)
230 Control the balance of positive and negative weights, useful for unbalanced classes. A typical value to consider: \verb{sum(negative instances) / sum(positive instances)}. See \href{https://xgboost.readthedocs.io/en/latest/tutorials/param_tuning.html}{Parameters Tuning} for more discussion. Also, see Higgs Kaggle competition demo for examples: \href{https://github.com/dmlc/xgboost/blob/master/demo/kaggle-higgs/higgs-train.R}{R}, \href{https://github.com/dmlc/xgboost/blob/master/demo/kaggle-higgs/higgs-numpy.py}{py1}, \href{https://github.com/dmlc/xgboost/blob/master/demo/kaggle-higgs/higgs-cv.py}{py2}, \href{https://github.com/dmlc/xgboost/blob/master/demo/guide-python/cross_validation.py}{py3}.}
231
232 \item{updater}{Has different meanings depending on the type of booster.
233 \itemize{
234 \item For tree-based boosters:
235 A comma separated string defining the sequence of tree updaters to run, providing a modular way to construct and to modify the trees. This is an advanced parameter that is usually set automatically, depending on some other parameters. However, it could be also set explicitly by a user. The following updaters exist:
236 \itemize{
237 \item \code{"grow_colmaker"}: non-distributed column-based construction of trees.
238 \item \code{"grow_histmaker"}: distributed tree construction with row-based data splitting based on global proposal of histogram counting.
239 \item \code{"grow_quantile_histmaker"}: Grow tree using quantized histogram.
240 \item \code{"grow_gpu_hist"}: Enabled when \code{tree_method} is set to \code{"hist"} along with \code{device="cuda"}.
241 \item \code{"grow_gpu_approx"}: Enabled when \code{tree_method} is set to \code{"approx"} along with \code{device="cuda"}.
242 \item \code{"sync"}: synchronizes trees in all distributed nodes.
243 \item \code{"refresh"}: refreshes tree's statistics and/or leaf values based on the current data. Note that no random subsampling of data rows is performed.
244 \item \code{"prune"}: prunes the splits where loss < \code{min_split_loss} (or \code{gamma}) and nodes that have depth greater than \code{max_depth}.
245 }
246 \item For \code{booster="gblinear"}:
247 (default= \code{"shotgun"}) Choice of algorithm to fit linear model
248 \itemize{
249 \item \code{"shotgun"}: Parallel coordinate descent algorithm based on shotgun algorithm. Uses 'hogwild' parallelism and therefore produces a nondeterministic solution on each run.
250 \item \code{"coord_descent"}: Ordinary coordinate descent algorithm. Also multithreaded but still produces a deterministic solution. When the \code{device} parameter is set to \code{"cuda"} or \code{"gpu"}, a GPU variant would be used.
251 }
252 }}
253
254 \item{refresh_leaf}{(for Tree Booster) (default=1)
255 This is a parameter of the \code{"refresh"} updater. When this flag is 1, tree leafs as well as tree nodes' stats are updated. When it is 0, only node stats are updated.}
256
257 \item{grow_policy}{(for Tree Booster) (default= \code{"depthwise"})
258 \itemize{
259 \item Controls a way new nodes are added to the tree.
260 \item Currently supported only if \code{tree_method} is set to \code{"hist"} or \code{"approx"}.
261 \item Choices: \code{"depthwise"}, \code{"lossguide"}
262 \itemize{
263 \item \code{"depthwise"}: split at nodes closest to the root.
264 \item \code{"lossguide"}: split at nodes with highest loss change.
265 }
266 }}
267
268 \item{max_leaves}{(for Tree Booster) (default=0, type=int32)
269 Maximum number of nodes to be added. Not used by \code{"exact"} tree method.}
270
271 \item{max_bin}{(for Tree Booster) (default=256, type=int32)
272 \itemize{
273 \item Only used if \code{tree_method} is set to \code{"hist"} or \code{"approx"}.
274 \item Maximum number of discrete bins to bucket continuous features.
275 \item Increasing this number improves the optimality of splits at the cost of higher computation time.
276 }}
277
278 \item{num_parallel_tree}{(for Tree Booster) (default=1)
279 Number of parallel trees constructed during each iteration. This option is used to support boosted random forest.}
280
281 \item{monotone_constraints}{(for Tree Booster)
282 Constraint of variable monotonicity. See \href{https://xgboost.readthedocs.io/en/latest/tutorials/monotonic.html}{Monotonic Constraints} for more information.}
283
284 \item{interaction_constraints}{(for Tree Booster)
285 Constraints for interaction representing permitted interactions. The constraints must
286 be specified in the form of a nest list, e.g. \code{list(c(0, 1), c(2, 3, 4))}, where each inner
287 list is a group of indices of features (base-0 numeration) that are allowed to interact with each other.
288 See \href{https://xgboost.readthedocs.io/en/latest/tutorials/feature_interaction_constraint.html}{Feature Interaction Constraints} for more information.}
289
290 \item{multi_strategy}{(for Tree Booster) (default = \code{"one_output_per_tree"})
291 The strategy used for training multi-target models, including multi-target regression
292 and multi-class classification. See \href{https://xgboost.readthedocs.io/en/latest/tutorials/multioutput.html}{Multiple Outputs} for more information.
293 \itemize{
294 \item \code{"one_output_per_tree"}: One model for each target.
295 \item \code{"multi_output_tree"}: Use multi-target trees.
296 }
297
298 Version added: 2.0.0
299
300 Note: This parameter is working-in-progress.}
301
302 \item{base_score}{\itemize{
303 \item The initial prediction score of all instances, global bias
304 \item The parameter is automatically estimated for selected objectives before training. To
305 disable the estimation, specify a real number argument.
306 \item If \code{base_margin} is supplied, \code{base_score} will not be added.
307 \item For sufficient number of iterations, changing this value will not have too much effect.
308 }}
309
310 \item{eval_metric}{(default according to objective)
311 \itemize{
312 \item Evaluation metrics for validation data, a default metric will be assigned according to objective (rmse for regression, and logloss for classification, \verb{mean average precision} for \code{rank:map}, etc.)
313 \item User can add multiple evaluation metrics.
314 \item The choices are listed below:
315 \itemize{
316 \item \code{"rmse"}: root mean square error
317 \item \code{"rmsle"}: root mean square log error: \eqn{\sqrt{\frac{1}{N}[log(pred + 1) - log(label + 1)]^2}}. Default metric of \code{"reg:squaredlogerror"} objective. This metric reduces errors generated by outliers in dataset. But because \code{log} function is employed, \code{"rmsle"} might output \code{nan} when prediction value is less than -1. See \code{"reg:squaredlogerror"} for other requirements.
318 \item \code{"mae"}: mean absolute error.
319 \item \code{"mape"}: mean absolute percentage error.
320 \item \code{"mphe"}: mean Pseudo Huber error. Default metric of \code{"reg:pseudohubererror"} objective.
321 \item \code{"logloss"}: negative log-likelihood.
322 \item \code{"error"}: Binary classification error rate. It is calculated as \verb{#(wrong cases)/#(all cases)}. For the predictions, the evaluation will regard the instances with prediction value larger than 0.5 as positive instances, and the others as negative instances.
323 \item \code{"error@t"}: a different than 0.5 binary classification threshold value could be specified by providing a numerical value through 't'.
324 \item \code{"merror"}: Multiclass classification error rate. It is calculated as \verb{#(wrong cases)/#(all cases)}.
325 \item \code{"mlogloss"}: \href{https://scikit-learn.org/stable/modules/generated/sklearn.metrics.log_loss.html}{Multiclass logloss}.
326 \item \code{"auc"}: area under the receiver-operating characteristic curve.
327 Available for classification and learning-to-rank tasks.
328 \itemize{
329 \item When used with binary classification, the objective should be \code{"binary:logistic"} or similar functions that work on probability.
330 \item When used with multi-class classification, objective should be \code{"multi:softprob"} instead of \code{"multi:softmax"}, as the latter doesn't output probability. Also the AUC is calculated by 1-vs-rest with reference class weighted by class prevalence.
331 \item When used with LTR task, the AUC is computed by comparing pairs of documents to count correctly sorted pairs. This corresponds to pairwise learning to rank. The implementation has some issues with average AUC around groups and distributed workers not being well-defined.
332 \item On a single machine the AUC calculation is exact. In a distributed environment the AUC is a weighted average over the AUC of training rows on each node - therefore, distributed AUC is an approximation sensitive to the distribution of data across workers. Use another metric in distributed environments if precision and reproducibility are important.
333 \item When input dataset contains only negative or positive samples, the output is \code{NaN}. The behavior is implementation defined, for instance, \code{scikit-learn} returns \eqn{0.5} instead.
334 }
335 \item \code{"aucpr"}: area under the PR curve
336 Available for classification and learning-to-rank tasks.
337
338 After XGBoost 1.6, both of the requirements and restrictions for using \code{"aucpr"} in classification problem are similar to \code{"auc"}. For ranking task, only binary relevance label \eqn{y \in [0, 1]} is supported. Different from \code{"map"} (mean average precision), \code{"aucpr"} calculates the \emph{interpolated} area under precision recall curve using continuous interpolation.
339 \item \code{"pre"}: Precision at \eqn{k}. Supports only learning to rank task.
340 \item \code{"ndcg"}: normalized discounted cumulative gain
341 \item \code{"map"}: mean average precision
342
343 The \verb{average precision} is defined as:
344
345 \eqn{AP@l = \frac{1}{min{(l, N)}}\sum^l_{k=1}P@k \cdot I_{(k)}}
346
347 where \eqn{I_{(k)}} is an indicator function that equals to \eqn{1} when the document at \eqn{k} is relevant and \eqn{0} otherwise. The \eqn{P@k} is the precision at \eqn{k}, and \eqn{N} is the total number of relevant documents. Lastly, the \verb{mean average precision} is defined as the weighted average across all queries.
348 \item \code{"ndcg@n"}, \code{"map@n"}, \code{"pre@n"}: \eqn{n} can be assigned as an integer to cut off the top positions in the lists for evaluation.
349 \item \code{"ndcg-"}, \code{"map-"}, \code{"ndcg@n-"}, \code{"map@n-"}: In XGBoost, the NDCG and MAP evaluate the score of a list without any positive samples as \eqn{1}. By appending "-" to the evaluation metric name, we can ask XGBoost to evaluate these scores as \eqn{0} to be consistent under some conditions.
350 \item \code{"poisson-nloglik"}: negative log-likelihood for Poisson regression
351 \item \code{"gamma-nloglik"}: negative log-likelihood for gamma regression
352 \item \code{"cox-nloglik"}: negative partial log-likelihood for Cox proportional hazards regression
353 \item \code{"gamma-deviance"}: residual deviance for gamma regression
354 \item \code{"tweedie-nloglik"}: negative log-likelihood for Tweedie regression (at a specified value of the \code{tweedie_variance_power} parameter)
355 \item \code{"aft-nloglik"}: Negative log likelihood of Accelerated Failure Time model.
356 See \href{https://xgboost.readthedocs.io/en/latest/tutorials/aft_survival_analysis.html}{Survival Analysis with Accelerated Failure Time} for details.
357 \item \code{"interval-regression-accuracy"}: Fraction of data points whose predicted labels fall in the interval-censored labels.
358 Only applicable for interval-censored data. See \href{https://xgboost.readthedocs.io/en/latest/tutorials/aft_survival_analysis.html}{Survival Analysis with Accelerated Failure Time} for details.
359 }
360 }}
361
362 \item{seed_per_iteration}{(default= \code{FALSE})
363 Seed PRNG determnisticly via iterator number.}
364
365 \item{device}{(default= \code{"cpu"})
366 Device for XGBoost to run. User can set it to one of the following values:
367 \itemize{
368 \item \code{"cpu"}: Use CPU.
369 \item \code{"cuda"}: Use a GPU (CUDA device).
370 \item \code{"cuda:<ordinal>"}: \verb{<ordinal>} is an integer that specifies the ordinal of the GPU (which GPU do you want to use if you have more than one devices).
371 \item \code{"gpu"}: Default GPU device selection from the list of available and supported devices. Only \code{"cuda"} devices are supported currently.
372 \item \code{"gpu:<ordinal>"}: Default GPU device selection from the list of available and supported devices. Only \code{"cuda"} devices are supported currently.
373 }
374
375 For more information about GPU acceleration, see \href{https://xgboost.readthedocs.io/en/latest/gpu/index.html}{XGBoost GPU Support}. In distributed environments, ordinal selection is handled by distributed frameworks instead of XGBoost. As a result, using \code{"cuda:<ordinal>"} will result in an error. Use \code{"cuda"} instead.
376
377 Version added: 2.0.0
378
379 Note: if XGBoost was installed from CRAN, it won't have GPU support enabled, thus only \code{"cpu"} will be available.
380 To get GPU support, the R package for XGBoost must be installed from source or from the GitHub releases - see
381 \href{https://xgboost.readthedocs.io/en/latest/install.html#r}{instructions}.}
382
383 \item{disable_default_eval_metric}{(default= \code{FALSE})
384 Flag to disable default metric. Set to 1 or \code{TRUE} to disable.}
385
386 \item{use_rmm}{Whether to use RAPIDS Memory Manager (RMM) to allocate cache GPU
387 memory. The primary memory is always allocated on the RMM pool when XGBoost is built
388 (compiled) with the RMM plugin enabled. Valid values are \code{TRUE} and \code{FALSE}. See
389 \href{https://xgboost.readthedocs.io/en/latest/python/rmm-examples/index.html}{Using XGBoost with RAPIDS Memory Manager (RMM) plugin} for details.}
390
391 \item{max_cached_hist_node}{(for Non-Exact Tree Methods) (default = 65536)
392 Maximum number of cached nodes for histogram. This can be used with the \code{"hist"} and the
393 \code{"approx"} tree methods.
394
395 Version added: 2.0.0
396 \itemize{
397 \item For most of the cases this parameter should not be set except for growing deep
398 trees. After 3.0, this parameter affects GPU algorithms as well.
399 }}
400
401 \item{max_cat_to_onehot}{(for Non-Exact Tree Methods)
402 A threshold for deciding whether XGBoost should use one-hot encoding based split for
403 categorical data. When number of categories is lesser than the threshold then one-hot
404 encoding is chosen, otherwise the categories will be partitioned into children nodes.
405
406 Version added: 1.6.0}
407
408 \item{max_cat_threshold}{(for Non-Exact Tree Methods)
409 Maximum number of categories considered for each split. Used only by partition-based
410 splits for preventing over-fitting.
411
412 Version added: 1.7.0}
413
414 \item{sample_type}{(for Dart Booster) (default= \code{"uniform"})
415 Type of sampling algorithm.
416 \itemize{
417 \item \code{"uniform"}: dropped trees are selected uniformly.
418 \item \code{"weighted"}: dropped trees are selected in proportion to weight.
419 }}
420
421 \item{normalize_type}{(for Dart Booster) (default= \code{"tree"})
422 Type of normalization algorithm.
423 \itemize{
424 \item \code{"tree"}: new trees have the same weight of each of dropped trees.
425 \itemize{
426 \item Weight of new trees are \code{1 / (k + learning_rate)}.
427 \item Dropped trees are scaled by a factor of \code{k / (k + learning_rate)}.
428 }
429 \item \code{"forest"}: new trees have the same weight of sum of dropped trees (forest).
430 \itemize{
431 \item Weight of new trees are \code{1 / (1 + learning_rate)}.
432 \item Dropped trees are scaled by a factor of \code{1 / (1 + learning_rate)}.
433 }
434 }}
435
436 \item{rate_drop}{(for Dart Booster) (default=0.0)
437 Dropout rate (a fraction of previous trees to drop during the dropout).
438
439 range: \eqn{[0.0, 1.0]}}
440
441 \item{one_drop}{(for Dart Booster) (default=0)
442 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).}
443
444 \item{skip_drop}{(for Dart Booster) (default=0.0)
445 Probability of skipping the dropout procedure during a boosting iteration.
446 \itemize{
447 \item If a dropout is skipped, new trees are added in the same manner as \code{"gbtree"}.
448 \item Note that non-zero \code{skip_drop} has higher priority than \code{rate_drop} or \code{one_drop}.
449 }
450
451 range: \eqn{[0.0, 1.0]}}
452
453 \item{feature_selector}{(for Linear Booster) (default= \code{"cyclic"})
454 Feature selection and ordering method
455 \itemize{
456 \item \code{"cyclic"}: Deterministic selection by cycling through features one at a time.
457 \item \code{"shuffle"}: Similar to \code{"cyclic"} but with random feature shuffling prior to each update.
458 \item \code{"random"}: A random (with replacement) coordinate selector.
459 \item \code{"greedy"}: Select coordinate with the greatest gradient magnitude. It has \code{O(num_feature^2)} complexity. It is fully deterministic. It allows restricting the selection to \code{top_k} features per group with the largest magnitude of univariate weight change, by setting the \code{top_k} parameter. Doing so would reduce the complexity to \code{O(num_feature*top_k)}.
460 \item \code{"thrifty"}: Thrifty, approximately-greedy feature selector. Prior to cyclic updates, reorders features in descending magnitude of their univariate weight changes. This operation is multithreaded and is a linear complexity approximation of the quadratic greedy selection. It allows restricting the selection to \code{top_k} features per group with the largest magnitude of univariate weight change, by setting the \code{top_k} parameter.
461 }}
462
463 \item{top_k}{(for Linear Booster) (default=0)
464 The number of top features to select in \code{greedy} and \code{thrifty} feature selector. The value of 0 means using all the features.}
465
466 \item{num_class}{Number of classes when using multi-class classification objectives (e.g. \code{objective="multi:softprob"})}
467
468 \item{tweedie_variance_power}{(for Tweedie Regression (\code{"objective=reg:tweedie"})) (default=1.5)
469 \itemize{
470 \item Parameter that controls the variance of the Tweedie distribution \code{var(y) ~ E(y)^tweedie_variance_power}
471 \item range: \eqn{(1,2)}
472 \item Set closer to 2 to shift towards a gamma distribution
473 \item Set closer to 1 to shift towards a Poisson distribution.
474 }}
475
476 \item{huber_slope}{(for using Pseudo-Huber (\verb{"reg:pseudohubererror}")) (default = 1.0)
477 A parameter used for Pseudo-Huber loss to define the \eqn{\delta} term.}
478
479 \item{quantile_alpha}{(for using Quantile Loss (\code{"reg:quantileerror"}))
480 A scalar or a list of targeted quantiles (passed as a numeric vector).
481
482 Version added: 2.0.0}
483
484 \item{aft_loss_distribution}{(when using AFT Survival Loss (\code{"survival:aft"}) and Negative Log Likelihood of AFT metric (\code{"aft-nloglik"}))
485 Probability Density Function, \code{"normal"}, \code{"logistic"}, or \code{"extreme"}.}
486
487 \item{aft_loss_distribution_scale}{(when using AFT Survival Loss (\code{"survival:aft"}) and Negative Log Likelihood of AFT metric (\code{"aft-nloglik"}))
488 Scaling factor for the AFT distribution. Range: \eqn{(0, \infty)}.}
489
490 \item{lambdarank_pair_method}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"})) (default = \code{"topk"})
491 How to construct pairs for pair-wise learning.
492 \itemize{
493 \item \code{"mean"}: Sample \code{lambdarank_num_pair_per_sample} pairs for each document in the query list.
494 \item \code{"topk"}: Focus on top-\code{lambdarank_num_pair_per_sample} documents. Construct \eqn{|query|} pairs for each document at the top-\code{lambdarank_num_pair_per_sample} ranked by the model.
495 }}
496
497 \item{lambdarank_num_pair_per_sample}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"}))
498 It specifies the number of pairs sampled for each document when pair method is \code{"mean"}, or the truncation level for queries when the pair method is \code{"topk"}. For example, to train with \verb{ndcg@6}, set \code{"lambdarank_num_pair_per_sample"} to \eqn{6} and \code{lambdarank_pair_method} to \code{"topk"}.
499
500 range = \eqn{[1, \infty)}}
501
502 \item{lambdarank_normalization}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"})) (default = \code{TRUE})
503 Whether to normalize the leaf value by lambda gradient. This can sometimes stagnate the training progress.
504
505 Version added: 2.1.0}
506
507 \item{lambdarank_score_normalization}{Whether to normalize the delta metric by the difference of prediction scores. This can
508 sometimes stagnate the training progress. With pairwise ranking, we can normalize the
509 gradient using the difference between two samples in each pair to reduce influence from
510 the pairs that have large difference in ranking scores. This can help us regularize the
511 model to reduce bias and prevent overfitting. Similar to other regularization
512 techniques, this might prevent training from converging.
513
514 There was no normalization before 2.0. In 2.0 and later versions this is used by
515 default. In 3.0, we made this an option that users can disable.
516
517 Version added: 3.0.0}
518
519 \item{lambdarank_unbiased}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"})) (default = \code{FALSE})
520 Specify whether do we need to debias input click data.}
521
522 \item{lambdarank_bias_norm}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"})) (default = 2.0)
523 \eqn{L_p} normalization for position debiasing, default is \eqn{L_2}. Only relevant when \code{lambdarank_unbiased} is set to \code{TRUE}.}
524
525 \item{ndcg_exp_gain}{(for learning to rank (\code{"rank:ndcg"}, \code{"rank:map"}, \code{"rank:pairwise"})) (default = \code{TRUE})
526 Whether we should use exponential gain function for \code{NDCG}. There are two forms of gain function for \code{NDCG}, one is using relevance value directly while the other is using\eqn{2^{rel} - 1} to emphasize on retrieving relevant documents. When \code{ndcg_exp_gain} is \code{TRUE} (the default), relevance degree cannot be greater than 31.}
527 }
528 \value{
529 A list with the entries that were passed non-NULL values. It is intended to
530 be passed as argument \code{params} to \code{\link[=xgb.train]{xgb.train()}} or \code{\link[=xgb.cv]{xgb.cv()}}.
531 }
532 \description{
533 Convenience function to generate a list of named XGBoost parameters, which
534 can be passed as argument \code{params} to \code{\link[=xgb.train]{xgb.train()}}. See the \href{https://xgboost.readthedocs.io/en/stable/parameter.html}{online documentation} for more details.
535
536 The purpose of this function is to enable IDE autocompletions and to provide in-package
537 documentation for all the possible parameters that XGBoost accepts. The output from this
538 function is just a regular R list containing the parameters that were set to non-default
539 values. Note that this function will not perform any validation on the supplied arguments.
540
541 If passing \code{NULL} for a given parameter (the default for all of them), then the default
542 value for that parameter will be used. Default values are automatically determined by the
543 XGBoost core library upon calls to \code{\link[=xgb.train]{xgb.train()}} or \code{\link[=xgb.cv]{xgb.cv()}}, and are subject to change
544 over XGBoost library versions. Some of them might differ according to the
545 booster type (e.g. defaults for regularization are different for linear and tree-based boosters).
546 }