Understanding the AUC-ROC Curve.

Abhigyan
Analytics Vidhya
Published in
3 min readApr 19, 2020

This is something everyone starting out with machine learning have come across,where mentors and people learning machine learning equally says plot the roc graph and see how well your classification model is performing.SO,

What is ROC curve?

ROC curve is one the important evaluating metrics that should be used to check the performance of an classification model.It is also called relative operating characteristic curve, because it is a comparison of two main characteristics (TPR and FPR).

It is plotted between sensitivity(aka recall aka True Positive Rate) and False Positive Rate(FPR = 1-specificity).

If you are not getting the terms sensitivity and specificity,I suggest you go down to confusion matrix in this link.

The above figure shows the ROC-AUC plot,The further the curve(blue line) is from the diagonal line or may i say the closer the blue line is to the 1 in Y-axis, the more better the model is at discriminating between positives and negatives.

What is AUC?

AUC also called as AREA UNDER CURVE.It is used in classification analysis in order to determine which of the used models predicts the classes best. An example of its application are ROC curves.

AUC ranges in value from 0 to 1. A model whose predictions are 100% wrong has an AUC of 0 and if the predictions are 100% correct has an AUC of 1.

characteristics of AUC:

  • AUC is scale-invariant. It measures how well predictions are ranked, rather than their absolute values.
  • AUC is classification-threshold-invariant. It measures the quality of the model’s predictions irrespective of what classification threshold is chosen.

ALSO, ROC-AUC CANNOT BE PLOTTED FOR REGRESSION PROBLEMS,IT IS ONLY PLOTTED FOR CLASSIFICATION PROBLEMS AS ON THE X-AXIS 1-specificity AND ON THE Y-AXIS sensitivity IS TAKEN TO PLOT THE GRAPH.

How is auc calculated?

T = (1*SE)/2 = SE/2 = TP/2*(TP+FN)

U = (SP*1)/2 = SP/2 = TN/2*(TN+FP)

Getting the AUC,

AUC= T+U = (SE+SP)/2

ROC-AUC can also be plotted for multiclass problems and even ROC for different models can be plotted on the same graph for comparison.

Multiclass Data ROC PLOT

Check out this link for the code example of multiclass ROC plot and finding out there auc.

ROC PLOT to compare the performance of different models.

Like my article? Do give me a clap and share it,as that will boost my confidence.Also,I post new articles every sunday so stay connected for future articles of the basics of data science and machine learning series.

Also,if you want then connect with me on linkedIn.

Photo by Alex on Unsplash

--

--