train_model3: Train model 3

View source: R/train_model3.R

train_model3R Documentation

Train model 3

Description

Train model 3

Usage

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
)

Arguments

dat

a data.frame of input data.

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

importance of ranger.

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.

Details

Key steps:

  1. Tuning loop tunes single parameter mtry.

  2. Outer cross-validation split the data set into training and testing set of M folds.

  3. 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.

Value

a list of cross-validation result of given mtry values.


markgene/yamatClassifier documentation built on Oct. 14, 2024, 2:36 a.m.