# auc-methods: Methods for Function 'auc' in Package 'HandTill2001' In nkola123/kola: Multiple Class Area under ROC Curve

## Description

Calculate area under curve of the receiver operating characteristic for two or more prediction classes.

## Details

Depending on whether `object` is of class `"bincap"` or of class `"multcap"`, a two class or multiple class AUC is calculated.

## Value

An object of class `"numeric"`.

## Methods

`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).

## 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.

`"class?bincap"`, `"class?multcap"`

## Examples

 ``` 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)]) )) ```

nkola123/kola documentation built on May 23, 2019, 9:05 p.m.