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:

  • "boosting" for Boosting classifiers.

  • "rf" for Random Forest.

  • "lasso" for Lasso regression.

  • "ridge" for Ridge regression.

  • "svm" for Support Vector Machines.

...

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:

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

[Package RobustPrediction version 0.1.7 Index]