auc-methods {HandTill2001} | R Documentation |
Methods for Function auc
in Package HandTill2001
Description
Calculate area under curve of the receiver operating characteristic for two or more prediction classes.
Usage
## S4 method for signature 'bincap'
auc(object)
## S4 method for signature 'multcap'
auc(object)
Arguments
object |
An object of |
Details
Depending on whether object
is of class bincap
or of class
multcap
, a binary class or multiple class AUC is calculated.
Value
An object of class "numeric"
.
Methods
- signature(object = "bincap")
calculates the AUC statistic for a binary 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).
References
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.
See Also
Examples
data(ht01.twoclass, package = "HandTill2001")
message(" == AUC for a binary class response")
message(" == == HandTill2001 result:")
HandTill2001::auc(HandTill2001::bincap(
response = as.factor(ht01.twoclass[["observed"]]),
predicted = ht01.twoclass[["predicted"]],
true = "1"
))
## Not run:
message(" == == ROCR result:")
ROCR::performance(ROCR::prediction(
labels = ht01.twoclass[["observed"]],
predictions = ht01.twoclass[["predicted"]]
),
measure = "auc"
)@y.values
## End(Not run)
data(ht01.multipleclass, package = "HandTill2001")
message(" == AUC for a multiple class response")
predicted <- as.matrix(ht01.multipleclass[, levels(ht01.multipleclass[["observed"]])])
HandTill2001::auc(HandTill2001::multcap(
response = ht01.multipleclass[["observed"]],
predicted = predicted
))
[Package HandTill2001 version 1.0.1 Index]