KTSP.Classifiy {switchBox} | R Documentation |
KTSP.Classify
classifies new test samples
using KTSP coming out of the function KTSP.Train
.
This function was used in Marchionni et al, 2013, BMC Genomics,
and it is maintained only for backward compatibility.
It has been replaced by SWAP.KTSP.Classify
.
KTSP.Classify(data, classifier, combineFunc)
data |
the test data: a matrix in which the rows represent the genes and the columns the samples. |
classifier |
The output of |
combineFunc |
A user defined function to combine the predictions of the individual K TSPs. If missing the consensus classification among the majority of the TSPs will be used. |
Bahman Afsari bahman.afsari@gmail.com, Luigi Marchionni marchion@jhu.edu
See switchBox for the references.
KTSP.Train
,
SWAP.KTSP.Classify
,
################################################## ### Load gene expression data for the training set data(trainingData) ### Turn into a numeric vector with values equal to 0 and 1 trainingGroupNum <- as.numeric(trainingGroup) - 1 ### Show group variable for the TRAINING set table(trainingGroupNum) ################################################## ### Train a classifier using default filtering function based on the Wilcoxon test classifier <- KTSP.Train(matTraining, trainingGroupNum, n=8) ### Show the classifier classifier ################################################## ### Testing on new data ### Load the example data for the TEST set data(testingData) ### Turn into a numeric vector with values equal to 0 and 1 testingGroupNum <- as.numeric(testingGroup) - 1 ### Show group variable for the TEST set table(testingGroupNum) ### Apply the classifier to one sample of the TEST set using ### sum of votes grearter than 2 testPrediction <- KTSP.Classify(matTesting, classifier, combineFunc = function(x) sum(x) < 2.5) ### Show prediction table(testPrediction, testingGroupNum)