Learn R Programming

specmine (version 1.0)

train_models_performance: Train models

Description

Train various models.

Usage

train_models_performance(dataset, models, column.class, validation, num.folds = 10, num.repeats = 10, tunelength = 10, tunegrid = NULL, metric = NULL, summary.function = "default", class.in.metadata = T, compute.varimp = T)

Arguments

dataset
list representing the dataset from a metabolomics experiment.
models
models to be used in training.
column.class
metadata column class.
validation
validation method.
num.folds
number of folds in cross validation.
num.repeats
number of repeats.
tunelength
number of levels for each tuning parameters.
tunegrid
dataframe with possible tuning values.
metric
metric used to evaluate the model's performance. Can be "Accuracy" or "ROC".
summary.function
summary function. For "ROC" the multiClassSummary function must be used.
class.in.metadata
boolean value to indicate if the class is in metadata.
compute.varimp
boolean value to indicate if the var importance is calculated.

Value

Returns a list with the results from training
performance
The results from the best tunes of the models
vips
The variable importance from the models
full.results
The full results from the tuning parameters of each model
best.tunes
The best tune of each model
confusion.matrices
The confusion matrices of the models (only in classification)
final.models
The final models

Examples

Run this code
  ## Example of training models
  data(cachexia)
  result = train_models_performance(cachexia, "pls", 
	   "Muscle.loss", "cv")

Run the code above in your browser using DataLab