Description Usage Arguments Value Author(s) Examples
This function plots ROC curves for estimating the performance of machine learning-based classification model in cross validation experiments.
1 | plotROC(cvRes)
|
cvRes |
results from the "cross_validation" function. |
A ROC plot
Chuang Ma, Xiangfeng Wang
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 | ## Not run:
##generate expression feature matrix
sampleVec1 <- c(1, 2, 3, 4, 5, 6)
sampleVec2 <- c(1, 2, 3, 4, 5, 6)
featureMat <- expFeatureMatrix( expMat1 = ControlExpMat, sampleVec1 = sampleVec1,
expMat2 = SaltExpMat, sampleVec2 = sampleVec2,
logTransformed = TRUE, base = 2,
features = c("zscore", "foldchange", "cv", "expression"))
##positive samples
positiveSamples <- as.character(sampleData$KnownSaltGenes)
##unlabeled samples
unlabelSamples <- setdiff( rownames(featureMat), positiveSamples )
idx <- sample(length(unlabelSamples))
##randomly selecting a set of unlabeled samples as negative samples
negativeSamples <- unlabelSamples[idx[1:length(positiveSamples)]]
##five-fold cross validation
seed <- randomSeed() #generate a random seed
cvRes <- cross_validation(seed = seed, method = "randomForest",
featureMat = featureMat,
positives = positiveSamples, negatives = negativeSamples,
cross = 5, cpus = 1,
ntree = 100 ) ##parameters for random forest algorithm
#plot ROC curve
plotROC(cvRes)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.