Description Details Value Methods References See Also Examples
Calculate area under curve of the receiver operating characteristic for two or more prediction classes.
Depending on whether object
is of class "bincap"
or of class "multcap"
, a two class or multiple class AUC is calculated.
An object of class "numeric"
.
signature(object = "bincap")
calculates the AUC statistic for a two class response following Hand and Till (2001), Eq. (3).
signature(object = "multcap")
calculates the AUC statistic for a multiple class response following Hand and Till (2001), Eq. (7).
David J. Hand and Robert J. Till (2001). A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems. Machine Learning 45(2), p. 171–186. DOI: 10.1023/A:1010920819831.
"class?bincap"
, "class?multcap"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(HandTill2001)
data(ht01.twoclass)
data(ht01.multipleclass)
message(" == AUC for a two class response")
## Not run:
message(" == == ROCR result:")
library(ROCR)
performance(prediction(labels=ht01.twoclass$observed
, predictions=ht01.twoclass$predicted
)
, measure = "auc")
## End(Not run)
message(" == == HandTill2001 result:")
auc(bincap(
response = as.factor(ht01.twoclass$observed)
, predicted = ht01.twoclass$predicted
, true = "1"
))
message(" == AUC for a multiple class response")
auc(multcap(
response = ht01.multipleclass$observed
, predicted = as.matrix(ht01.multipleclass[, levels(ht01.multipleclass$observed)])
))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.