train_models_performance: Train models

Description Usage Arguments Value Examples

View source: R/machinelearning.R

Description

Train various models.

Usage

1
2
3
4
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 = TRUE, compute.varimp = TRUE)

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

1
2
3
4
5
  ## Example of training models
  library(specmine.datasets)
  data(cachexia)
  result = train_models_performance(cachexia, "pls", 
  	   "Muscle.loss", "cv")

specmine documentation built on Sept. 21, 2021, 5:06 p.m.