Description Usage Arguments Author(s) References See Also Examples
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
.
1 | 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
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ##################################################
### 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.