train_model3 | R Documentation |
Train model 3
train_model3(
dat,
response_name,
outer_cv_folds = 5,
inner_cv_folds = 5,
random_state = 56,
mtry = NULL,
selected_features = NULL,
importance = "permutation",
save_level = 3,
save_prefix = "train_model3_",
overwrite = FALSE,
output = NULL,
verbose = TRUE
)
dat |
a |
response_name |
column name of the response. |
outer_cv_folds |
outer cross-validation fold number. |
inner_cv_folds |
inner cross-validation fold number. |
random_state |
random seed. |
mtry |
A vector of mtry for parameter tuning. |
selected_features |
features selected. |
importance |
|
save_level |
if save_level > 0, save outer train index. If save_level > 1, save calibrated probabilities and selected features in addition. |
save_prefix |
output file prefix. |
overwrite |
overwrite existing result files or not. |
output |
output directory. |
verbose |
A bool. |
Key steps:
Tuning loop tunes single parameter mtry
.
Outer cross-validation split the data set into training and testing set of M folds.
Inner cross-validation split the training set of the outer CV into
N folds. Each fold does random forest classification. When all folds
are done. Train calibration model of Ridge multinomial logistic
regression (MR) regression. The lambda is trained with
cv.glmnet
. The random forest and calibration
models are used for the testing set of the outer CV.
a list of cross-validation result of given mtry
values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.