Description Usage Arguments Details Value Author(s) See Also Examples
Calculates the AUC and plots ROC for supervised models from s/plsda, mint.s/plsda and block.plsda, block.splsda or wrapper.sgccda functions.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | auroc(object, ...)
## S3 method for class 'mixo_plsda'
auroc(
object,
newdata = object$input.X,
outcome.test = as.factor(object$Y),
multilevel = NULL,
plot = TRUE,
roc.comp = 1,
title = paste("ROC Curve Comp", roc.comp),
print = TRUE,
...
)
## S3 method for class 'mixo_splsda'
auroc(
object,
newdata = object$input.X,
outcome.test = as.factor(object$Y),
multilevel = NULL,
plot = TRUE,
roc.comp = 1,
title = paste("ROC Curve Comp", roc.comp),
print = TRUE,
...
)
## S3 method for class 'mint.plsda'
auroc(
object,
newdata = object$X,
outcome.test = as.factor(object$Y),
study.test = object$study,
multilevel = NULL,
plot = TRUE,
roc.comp = 1,
roc.study = "global",
title = NULL,
print = TRUE,
...
)
## S3 method for class 'mint.splsda'
auroc(
object,
newdata = object$X,
outcome.test = as.factor(object$Y),
study.test = object$study,
multilevel = NULL,
plot = TRUE,
roc.comp = 1,
roc.study = "global",
title = NULL,
print = TRUE,
...
)
## S3 method for class 'sgccda'
auroc(
object,
newdata = object$X,
outcome.test = as.factor(object$Y),
multilevel = NULL,
plot = TRUE,
roc.block = 1L,
roc.comp = 1L,
title = NULL,
print = TRUE,
...
)
## S3 method for class 'mint.block.plsda'
auroc(
object,
newdata = object$X,
study.test = object$study,
outcome.test = as.factor(object$Y),
multilevel = NULL,
plot = TRUE,
roc.block = 1,
roc.comp = 1,
title = NULL,
print = TRUE,
...
)
## S3 method for class 'mint.block.splsda'
auroc(
object,
newdata = object$X,
study.test = object$study,
outcome.test = as.factor(object$Y),
multilevel = NULL,
plot = TRUE,
roc.block = 1,
roc.comp = 1,
title = NULL,
print = TRUE,
...
)
|
object |
Object of class inherited from one of the following supervised analysis function: "plsda", "splsda", "mint.plsda", "mint.splsda", "block.splsda" or "wrapper.sgccda" |
... |
external optional arguments for plotting - |
newdata |
numeric matrix of predictors, by default set to the training data set (see details). |
outcome.test |
Either a factor or a class vector for the discrete outcome, by default set to the outcome vector from the training set (see details). |
multilevel |
Sample information when a newdata matrix is input and when
multilevel decomposition for repeated measurements is required. A numeric
matrix or data frame indicating the repeated measures on each individual,
i.e. the individuals ID. See examples in |
plot |
Whether the ROC curves should be plotted, by default set to TRUE (see details). |
roc.comp |
Specify the component (integer) for which the ROC will be plotted from the multivariate model, default to 1. |
title |
Character, specifies the title of the plot. |
print |
Logical, specifies whether the output should be printed. |
study.test |
For MINT objects, grouping factor indicating which samples
of |
roc.study |
Specify the study for which the ROC will be plotted for a mint.plsda or mint.splsda object, default to "global". |
roc.block |
Specify the block number (integer) or the name of the block (set of characters) for which the ROC will be plotted for a block.plsda or block.splsda object, default to 1. |
For more than two classes in the categorical outcome Y, the AUC is calculated as one class vs. the other and the ROC curves one class vs. the others are output.
The ROC and AUC are calculated based on the predicted scores obtained from
the predict
function applied to the multivariate methods
(predict(object)$predict
). Our multivariate supervised methods
already use a prediction threshold based on distances (see predict
)
that optimally determine class membership of the samples tested. As such AUC
and ROC are not needed to estimate the performance of the model (see
perf
, tune
that report classification error rates). We provide
those outputs as complementary performance measures.
The pvalue is from a Wilcoxon test between the predicted scores between one class vs the others.
External independent data set (newdata
) and outcome
(outcome.test
) can be input to calculate AUROC. The external data set
must have the same variables as the training data set (object$X
).
If newdata
is not provided, AUROC is calculated from the training
data set, and may result in overfitting (too optimistic results).
Note that for mint.plsda and mint.splsda objects, if roc.study
is
different from "global", then newdata
), outcome.test
and
sstudy.test
are not used.
Depending on the type of object used, a list that contains: The AUC and Wilcoxon test pvalue for each 'one vs other' classes comparison performed, either per component (splsda, plsda, mint.plsda, mint.splsda), or per block and per component (wrapper.sgccda, block.plsda, blocksplsda).
Benoit Gautier, Francois Bartolo, Florian Rohart, Al J Abadi
tune
, perf
, and http://www.mixOmics.org
for more details.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | ## example with PLSDA, 2 classes
# ----------------
data(breast.tumors)
X <- breast.tumors$gene.exp
Y <- breast.tumors$sample$treatment
plsda.breast <- plsda(X, Y, ncomp = 2)
auc.plsda.breast = auroc(plsda.breast, roc.comp = 1)
## Not run:
## example with sPLSDA
# -----------------
splsda.breast <- splsda(X, Y, ncomp = 2, keepX = c(25, 25))
auroc(plsda.breast, plot = FALSE)
## example with sPLSDA with 4 classes
# -----------------
data(liver.toxicity)
X <- as.matrix(liver.toxicity$gene)
# Y will be transformed as a factor in the function,
# but we set it as a factor to set up the colors.
Y <- as.factor(liver.toxicity$treatment[, 4])
splsda.liver <- splsda(X, Y, ncomp = 2, keepX = c(20, 20))
auc.splsda.liver = auroc(splsda.liver, roc.comp = 1)
## example with mint.plsda
# -----------------
data(stemcells)
res = mint.plsda(X = stemcells$gene, Y = stemcells$celltype, ncomp = 3,
study = stemcells$study)
auc.mint.pslda = auroc(res, plot = FALSE)
## example with mint.splsda
# -----------------
res = mint.splsda(X = stemcells$gene, Y = stemcells$celltype, ncomp = 3, keepX = c(10, 5, 15),
study = stemcells$study)
auc.mint.spslda = auroc(res, plot = TRUE, roc.comp = 3)
## example with block.plsda
# ------------------
data(nutrimouse)
data = list(gene = nutrimouse$gene, lipid = nutrimouse$lipid)
# with this design, all blocks are connected
design = matrix(c(0,1,1,0), ncol = 2, nrow = 2,
byrow = TRUE, dimnames = list(names(data), names(data)))
block.plsda.nutri = block.plsda(X = data, Y = nutrimouse$diet)
auc.block.plsda.nutri = auroc(block.plsda.nutri, roc.block = 'lipid')
## example with block.splsda
# ---------------
list.keepX = list(gene = rep(10, 2), lipid = rep(5,2))
block.splsda.nutri = block.splsda(X = data, Y = nutrimouse$diet, keepX = list.keepX)
auc.block.splsda.nutri = auroc(block.splsda.nutri, roc.block = 1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.