trainModel: Train a prediction model

Description Usage Arguments Value Author(s) Examples

View source: R/trainModel.R

Description

Trains a prediction model from an scPred object

Usage

1
2
3
4
trainModel(object, model = "svmRadial", resampleMethod = "cv",
  number = 5, seed = 66, metric = c("ROC", "PR", "Accuracy",
  "Kappa"), imbalance = 0.1, returnData = FALSE,
  savePredictions = "final", allowParallel = FALSE)

Arguments

object

An scPred object with informative PCs obtained using the getInformativePCs function

model

Classification model supported via caret package. A list of all models can be found here: https://topepo.github.io/caret/available-models.html Default: support vector machine with polynomial kernel

resampleMethod

Resample model used in trainControl function. Default: K-fold cross validation

number

Number of iterations for resample method. See trainControl function

seed

Numeric seed for resample method

returnData

If TRUE, training data is returned

savePredictions

an indicator of how much of the hold-out predictions for each resample should be saved. Values can be either "all", "final", or "none". A logical value can also be used that convert to "all" (for true) or "none" (for false). "final" saves the predictions for the optimal tuning parameters.

Value

A list of train objects for each cell class (e.g. cell type). See train function for details.

Author(s)

Jos<c3><a9> Alquicira Hern<c3><a1>ndez

Examples

1
2
3
4
5
6
7
# Train a SVM with a Radial kernel
## A numeric seed is provided for the K-fold cross validation
## The metric ROC is used to select the best tuned model. "Accuracy" and "Kappa" may be used too.

object <- trainModel(object = object,
                     seed = 1234,
                     metric = "ROC")

IMB-Computational-Genomics-Lab/scPred documentation built on Jan. 11, 2020, 7:37 a.m.