ph_ctrl {pheble} | R Documentation |
Parameters for resampling and training a dataset.
Description
The ph_ctrl
function automatically generates a trControl
object. This can be used in the train
function to automatically tune hyperparameters for every classification model in the ensemble.
Usage
ph_ctrl(
class,
resample_method = "boot",
number = ifelse(grepl("cv", resample_method, ignore.case = TRUE), 10, 25),
repeats = ifelse(grepl("dcv$", resample_method, ignore.case = TRUE), 3, NA),
search = "random",
sampling = NULL
)
Arguments
class |
A |
resample_method |
A |
number |
An |
repeats |
An |
search |
A |
sampling |
A |
Value
A trainControl
object for the train
function.
Examples
## Import data.
data(ph_crocs)
## Echo control object for train function.
ctrl <- ph_ctrl(ph_crocs$Species, resample_method = "boot")