powered by
Train a specific classifier.
train_classifier(dataset, column.class, model, validation, num.folds = 10, num.repeats = 10, tunelength = 10, tunegrid = NULL, metric = NULL, summary.function = defaultSummary, class.in.metadata = TRUE)
list representing the dataset from a metabolomics experiment.
metadata column class.
model to be used in training.
validation method.
number of folds in cross validation.
number of repeats.
number of levels for each tuning parameters.
dataframe with possible tuning values.
metric used to evaluate the model's performance. Can be "Accuracy" or "ROC".
summary function. For "ROC" the multiClassSummary function must be used.
boolean value to indicate if the class is in metadata.
Returns the train result object from caret.
# NOT RUN { ## Example of training a classifier library(specmine.datasets) data(cachexia) result = train_classifier(cachexia, "Muscle.loss", "pls", "cv") # }
Run the code above in your browser using DataLab