rocCV {nproc} | R Documentation |
Calculate the Receiver Operating Characteristics with Cross-validation or Subsampling
Description
rocCV
calculates the receiver operating characterisitc with cross-validation
Usage
rocCV(x = NULL, y, method = c("logistic", "penlog", "svm", "randomforest",
"lda", "nb", "ada", "tree"), metric = "CV", n.folds = 5,
train.frac = 0.5, n.cores = 1, randSeed = 0, ...)
Arguments
x |
n * p observation matrix. n observations, p covariates. |
y |
n 0/1 observatons. |
method |
classification method(s).
|
metric |
metric used for averging performance. Includes 'CV' and 'SS' as options. Default = 'CV'. |
n.folds |
number of folds used for cross-validation or the number of splits in the subsampling. Default = 5. |
train.frac |
fraction of training data in the subsampling process. Default = 0.5. |
n.cores |
number of cores used for parallel computing. Default = 1. |
randSeed |
the random seed used in the algorithm. Default = 0. |
... |
additional arguments. |
Value
A list.
fpr |
sequence of false positive rate. |
tpr |
sequence of true positive rate. |
References
Xin Tong, Yang Feng, and Jingyi Jessica Li (2018), Neyman-Pearson (NP) classification algorithms and NP receiver operating characteristic (NP-ROC), Science Advances, 4, 2, eaao1659.
See Also
Examples
n = 200
x = matrix(rnorm(n*2),n,2)
c = 1 - 3*x[,1]
y = rbinom(n,1,1/(1+exp(-c)))
fit = rocCV(x, y, method = 'svm')
fit2 = rocCV(x, y, method = 'penlog')
fit3 = rocCV(x, y, method = 'penlog', metric = 'SS')