'How to use AUC packet? to calculate AUC

I train and make prediction with the following example :

enter image description here

======================= The outputs are :

enter image description here

and :

enter image description here

Now I need to calculate AUC using the AUC package, but I can't quite understand how to do it?

auc(roc(????, ?????))

Thanks Manel



Solution 1:[1]

A possible solution could be :


library(AUC)
auc(roc(testing$Class, prediction$R)) # I get as an answer the "AUC"


result.auc <- auc(prediction$M, testing$Class)
result.roc <- roc(testing$Class, prediction$M)
plot(result.roc, print.thres="best", print.thres.best.method="closest.topleft") # plot the curve

You can comment on the solution, please¡¡¡¡

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1