tuneandtrainRobustTuneC {RobustPrediction} | R Documentation |
Tune and Train Classifier by Tuning Method RobustTuneC
Description
This function tunes and trains a specified classifier using the "RobustTuneC" method and the provided data.
Usage
tuneandtrainRobustTuneC(data, dataext, classifier, ...)
Arguments
data |
A data frame containing the training data. The first column should be the response variable (factor), and the remaining columns should be the predictor variables. |
dataext |
A data frame containing the external validation data. The first column should be the response variable (factor), and the remaining columns should be the predictor variables. |
classifier |
A character string specifying the classifier to use. Must be one of the following:
|
... |
Additional arguments to pass to the specific classifier function. |
Value
A list containing the results from the specific classifier's tuning and training process, the returned object typically includes:
-
best_hyperparams
: The best hyperparameters selected through the RobustTuneC method. -
best_model
: The final trained model based on the best hyperparameters. -
final_auc
: Performance metrics (AUC) of the final model.
Examples
# Load sample data
data(sample_data_train)
data(sample_data_extern)
# Example usage with Lasso
result_lasso <- tuneandtrainRobustTuneC(sample_data_train, sample_data_extern, classifier = "lasso",
maxit = 120000, nlambda = 100)
result_lasso$best_lambda
result_lasso$best_model
result_lasso$final_auc
result_lasso$active_set_Train
# Example usage with Ridge
result_ridge <- tuneandtrainRobustTuneC(sample_data_train, sample_data_extern,
classifier = "ridge", maxit = 120000, nlambda = 100)
result_ridge$best_lambda
result_ridge$best_model
result_ridge$final_auc