Skip to content
Middle+0 views

How is an ROC curve constructed, in general (what is the algorithm)?

Practice

Asked at

AI answer

A ROC curve is constructed by varying the classifier threshold and calculating the following for each threshold:

  • TPR (recall) = TP / (TP + FN)
  • FPR = FP / (FP + TN)

The points (FPR, TPR) are then plotted, with FPR on the X-axis and TPR on the Y-axis. Thresholds are usually swept from the strictest to the most lenient; connecting the points produces the ROC curve. The area under the curve (AUC) summarizes ranking quality: 1 is perfect, while around 0.5 is the level of random ranking. Calculations use the true labels and the model’s continuous scores, such as probabilities, rather than only the predicted classes.