-1

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

1 Answers1

0

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¡¡¡¡

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 12 '22 at 09:09
  • Hi, one possible solution is : – Manuel Soengas Núñez Mar 21 '22 at 20:34