What’s ROC curve?

Beytullah Soylev
2 min readApr 11, 2023

--

A ROC (Receiver Operating Characteristic) curve is a graphical representation of the performance of a binary classification model.

To create a ROC curve, we need to evaluate our binary classification model on a set of test data. For each data point, the model will output a probability score that the data point belongs to the positive class (i.e., the class we are interested in predicting). We then sort the test data points in descending order based on their probability scores.

ROC Curve

Next, we iterate through the sorted list of test data points, and for each point, we consider it as a threshold for deciding whether it belongs to the positive or negative class. For example, if the threshold is 0.5 and the probability score for a data point is greater than 0.5, we classify it as positive; otherwise, we classify it as negative.

As we vary the threshold from 0 to 1, we can calculate two quantities: the true positive rate (TPR) and false positive rate (FPR). The TPR is the proportion of positive data points that are correctly classified as positive, and the FPR is the proportion of negative data points that are incorrectly classified as positive.

The Formula of the ROC Curve

We can plot the TPR against the FPR at different thresholds to create the ROC curve. A good classification model will have a ROC curve that is closer to the top left corner of the plot, indicating a higher true positive rate and lower false positive rate across different threshold values.

Overall, the ROC curve helps us visualize the trade-off between the TPR and FPR at different threshold values, and it provides a way to evaluate the performance of a binary classification model.

“The greatest glory in living lies not in never falling, but in rising every time we fall.” -Nelson Mandela

Have a nice reading :D

--

--

No responses yet