This question already has an answer here:

I'm given a table

Class  |  Probability
P         .95
N         .85
P         .78

and so on. I'm asked to construct a ROC. As I understand, a ROC has TP for the Y axis and FP for X, but how can I get the TP/FP for the records in class N? For records in class P, TP is e.g. .95 and FP is .05, right? But what about records in class N? How can I find the TPR and FPR?


marked as duplicate by Sycorax, Community Nov 1 '16 at 15:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ you need to know what is the true class and what is your predicted class...looks like you getting a probability that observation being P class 0.95 etc. you can probably tell your classifier to give you the actual class. But it will only select a probability threshold (0.5 most likely) to determine the class. Then you can calculate ROC $\endgroup$ – Jan Sila Nov 1 '16 at 14:04
  • $\begingroup$ Unfortunately, we don't get the classifier, we're just told that "this data came from a classifier". I'll screenshot the question verbatim in case I'm leaving out some detail. $\endgroup$ – Matt G Nov 1 '16 at 14:07
  • $\begingroup$ imgur.com/a/Tw9kr $\endgroup$ – Matt G Nov 1 '16 at 14:08
  • $\begingroup$ Is this self-study? Please read the tag description and guidelines in the link. If it applies, add the tag to the question, otherwise ignore. Thanks. $\endgroup$ – Firebug Nov 1 '16 at 14:24
  • 1
    $\begingroup$ Also, the question is ambiguous, it doesn't tell if the class column is the predicted class or the true class, and so we can't interpret the probability column. Plotting the ROC is really simple though. $\endgroup$ – Firebug Nov 1 '16 at 14:26

Browse other questions tagged or ask your own question.