SWAP.KTSP.CV {switchBox} | R Documentation |
Partitions the data into k folds and applies
SWAP.GetKTSP.TrainTestResults
for each fold.
Then it combines prediction votes by dividing the vote
sums by the number of TSPs in each fold to produce an
overall cross-validation result.
SWAP.KTSP.CV(inputMat, Groups, classes = NULL, k = 4, folds = NULL, randomize = TRUE, ...)
inputMat |
is a matrix of data with rows being the features (such as gene names, if the matrix if gene expression data) and columns being the samples. |
Groups |
is a factor or a vector providing the phenotype class
each sample belongs to. It should correspond to the order of samples
given by the columns of |
classes |
is a vetor of length 2 providing the two phenotype or class labels. |
k |
an integer giving the number of folds to use. |
folds |
a list containing the samples to be used in each fold;
if |
randomize |
is a logical indicating whether to randomize the sample
order before diving into |
... |
any further arguments to be passed on for k-TSP training. |
A list with items:
folds |
A list containing the sample indices used in each fold. |
cv |
A list containing the classifier, training performance and testing performance for each fold. |
stats |
Overall cross-validation performance. |
roc |
ROC curve object for overall cross-validation performance. |
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) require(pROC) ### perform leave one out cross-validation result = SWAP.KTSP.CV(matTraining, trainingGroup, featureNo=100) ### print results result$stats