Description Usage Arguments Value Author(s)
Performing simple hyper-parameter grid search for xgboost. Model scoring can be done either with validation data or with V-fold cross-validation.
1 2 3 4 5 6 | xgb.grid(param_grid, data, nrounds, nfold, label = NULL, missing = NA,
prediction = FALSE, showsd = TRUE, metrics = list(), obj = NULL,
feval = NULL, stratified = TRUE, folds = NULL, verbose = TRUE,
early_stopping_rounds = NULL, maximize = NULL, callbacks = list(),
search_criteria, seed = NULL, order_metric_name = NULL,
validation_data = NULL, ...)
|
param_grid |
A named list with xgboost parameter names, consisting of vectors of hyper-parameter values.
The dataset containing the grid of possible hyper-parameters for model
training is formed internally by running |
data |
Same as in |
nrounds |
Same as in |
nfold |
Same as in |
label |
Same as in |
missing |
Same as in |
prediction |
Same as in |
showsd |
Same as in |
metrics |
Same as in |
obj |
Same as in |
feval |
Same as in |
stratified |
Same as in |
folds |
Same as in |
verbose |
Same as in |
early_stopping_rounds |
Same as in |
maximize |
Same as in |
callbacks |
Same as in |
search_criteria |
Define how to search over the grid of hyper-parameters.
This should be the list with parameters controlling the grid search.
Currently supported parameters are: |
seed |
Specify the seed to use for determining the random model order in random grid search. |
order_metric_name |
What is the name of the metric for ranking the final grid of model fits? |
validation_data |
Validation data to score the model performance while training with |
... |
Other parameters passed on directly to either |
A resulting grid search of model object fits in a form of a data.table
with xgboost
model fit
objects saved in a list column named 'xgb_fit'
.
In addition, the output data.table
contains the original hyper-parameters used as well as the model
performance metrics assessed by xgboost
. The dataset is sorted according to the order_metric_name
.
The code for using tidyverse
syntax for model grid search is borrowed and adapted from:
https://drsimonj.svbtle.com/grid-search-in-the-tidyverse.
The search_criteria
idea is borrowed from h2o::h2o.grid
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.