default_params {mixgb} | R Documentation |
Auxiliary function for validating xgb.params
Description
Auxiliary function for setting up the default XGBoost-related hyperparameters for mixgb and checking the xgb.params
argument in mixgb()
. For more details on XGBoost hyperparameters, please refer to XGBoost documentation on parameters.
Usage
default_params(
device = "cpu",
tree_method = "hist",
eta = 0.3,
gamma = 0,
max_depth = 3,
min_child_weight = 1,
max_delta_step = 0,
subsample = 0.7,
sampling_method = "uniform",
colsample_bytree = 1,
colsample_bylevel = 1,
colsample_bynode = 1,
lambda = 1,
alpha = 0,
max_leaves = 0,
max_bin = 256,
num_parallel_tree = 1,
nthread = -1
)
Arguments
device |
Can be either |
tree_method |
Options: |
eta |
Step size shrinkage. Default: 0.3. |
gamma |
Minimum loss reduction required to make a further partition on a leaf node of the tree. Default: 0 |
max_depth |
Maximum depth of a tree. Default: 3. |
min_child_weight |
Minimum sum of instance weight needed in a child. Default: 1. |
max_delta_step |
Maximum delta step. Default: 0. |
subsample |
Subsampling ratio of the data. Default: 0.7. |
sampling_method |
The method used to sample the data. Default: |
colsample_bytree |
Subsampling ratio of columns when constructing each tree. Default: 1. |
colsample_bylevel |
Subsampling ratio of columns for each level. Default: 1. |
colsample_bynode |
Subsampling ratio of columns for each node. Default: 1. |
lambda |
L2 regularization term on weights. Default: 1. |
alpha |
L1 regularization term on weights. Default: 0. |
max_leaves |
Maximum number of nodes to be added (Not used when |
max_bin |
Maximum number of discrete bins to bucket continuous features (Only used when |
num_parallel_tree |
The number of parallel trees used for boosted random forests. Default: 1. |
nthread |
The number of CPU threads to be used. Default: -1 (all available threads). |
Value
A list of hyperparameters.
Examples
default_params()
xgb.params <- list(device = "cuda", subsample = 0.9, nthread = 2)
default_params(device = xgb.params$device,
subsample = xgb.params$subsample,
nthread = xgb.params$nthread)
xgb.params <- do.call("default_params", xgb.params)
xgb.params