Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...