What is an ROC Curve?
An ROC curve plots the True Positive Rate (TPR) vs. the False Positive Rate (FPR) at various classification thresholds. Before we understand the ROC curve clearly, let’s try to understand a few terms.
Let’s say the expected or actual output for a classification problem is:
Ya = [False, False, True, True, True, False, True, False, False, True]
And the calculated or predicted output is:
Y = [True, False, True, True, False, False, True, False, False, True]
True Positives (TP): True positives are those output labels that are predicted to be True, and they are actually True.
True Negatives (TN): True negatives are the output labels that are predicted to be False, and they are actually False also.
False Positives (FP): False positives are the output labels that are predicted to be True, but they are actually False.
False Negatives (FN): False negatives are those output labels that are predicted to be False, but they are actually True.
Now, the True Positive Rate (TPR) or Recall is calculated as follows:
And the False Positive Rate is calculated as follows:
Please note that for a classification problem, the specificity or True Negative Rate is defined as:
How to calculate the Area Under the ROC Curve using sklearn in Python?
AUC or Area Under the ROC Curve measures the area under the ROC curve. It is a value from 0 to 1. If predictions are 100% …






0 Comments