powered by
Train a model and predict new unlabeled samples with that model.
train_and_predict(dataset, new.samples, column.class, model, validation, num.folds = 10, num.repeats = 10, tunelength = 10, tunegrid = NULL, metric = NULL, summary.function = defaultSummary)
list representing the dataset from a metabolomics experiment.
dataframe with new samples to predict the class label.
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.
Returns a list with the training result and the predictions result.
# NOT RUN { ## Example of training and predicting library(specmine.datasets) data(cachexia) result = train_and_predict(cachexia, new.samples = cachexia$data, "Muscle.loss", "pls", "cv") # }
Run the code above in your browser using DataLab