xgb_fit | R Documentation |
resamples
objectFit an xgboost model for each row of a resamples
object
xgb_fit(object, cores = 1, threads = 1, ...)
## S3 method for class 'resamples'
xgb_fit(object, cores = 1, threads = 1, ...)
## S3 method for class 'resamples_grid'
xgb_fit(object, cores = 1, threads = 1, ...)
object |
of class |
cores |
integer, number of cores to use for parallel computation. |
threads |
number of threads used to fit each model in parallel.
|
... |
passed to |
The input object (a tibble of class resamples
) with an additional
column called model
containing the fitted model object.
# regression
resample_boot(mtcars, 3) %>%
xgb_fit(resp="mpg", expl=c("cyl", "hp", "qsec"),
eta=0.1, max_depth=4, nrounds=20)
resample_boot(mtcars, 2) %>%
param_grid(eta=c(0.1, 0.2)) %>%
xgb_fit(resp="mpg", expl=c("cyl", "hp", "qsec"),
max_depth=4, nrounds=20)
# classification
mtcarsf <- mutate(mtcars, cyl=factor(cyl))
resample_boot(mtcarsf, 3) %>%
xgb_fit(resp="cyl", expl=c("mpg", "hp", "qsec"),
eta=0.1, max_depth=4, nrounds=20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.