SWAP.GetKTSP.PredictionStats {switchBox} | R Documentation |
Given a list of predicted labels and true labels, provides accuracy, sensitivity, specificity, balanced accuracy (i.e. (sensitivity+specificity)/2 ), and AUC if decision values are given.
SWAP.GetKTSP.PredictionStats(predictions, truth, classes=NULL, decision_values=NULL)
predictions |
is a vector or factor of predicted classes. |
truth |
is a vector or factor of the true class labels. |
classes |
is a character vector of length 2 providing the phenotype class labels (case followed by control). If NULL, the levels of phenoGroup will be taken as the labels. |
decision_values |
is a vector providing the decision values (such as sum of votes from a k-TSP classifier). Will be used to compute AUC if provided. |
A vector providing accuracy, sensitivity, specificity, and balanced accuracy
, and if decision_values
is prodvided, area under the ROC curve (AUC).
Bahman Afsari bahman.afsari@gmail.com, Luigi Marchionni marchion@jhu.edu, Wikum Dinalankara wdinala1@jhmi.edu
See switchBox for the references.
### Load gene expression data data(trainingData) data(testingData) ### train 1-TSP classifier = SWAP.Train.1TSP(matTraining, trainingGroup) predictions = SWAP.KTSP.Classify(matTesting, classifier) ### get performance results SWAP.GetKTSP.PredictionStats(predictions, testingGroup)