Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Machine Learning by (19k points)

Given a vector of scores and a vector of actual class labels, how do you calculate a single-number AUC metric for a binary classifier in the R language or in simple English?

Page 9 of "AUC: a Better Measure..." seems to require knowing the class labels, and here is an example in MATLAB where I don't understand

R(Actual == 1))

Because R (not to be confused with the R language) is defined as a vector but used as a function?

1 Answer

0 votes
by (33.1k points)

You can simply use The ROCR package, that will calculate the AUC among other statistics:

auc.tmp <- performance(pred,"auc");

auc <- as.numeric([email protected])

Hope this answer helps.

If you wish to learn R programming enroll for this R programming Certification.

Browse Categories