How the ROC Curve Is Built
For every possible threshold (0→1), we compute TPR (Sensitivity) and FPR (1 − Specificity):
TPR = TP / (TP + FN)
→ of all diabetics, how many caught?
FPR = FP / (FP + TN)
→ of all healthy, how many falsely flagged?
Plot (FPR, TPR) for each threshold → ROC curve
A perfect classifier hugs the top-left corner. A random classifier lies on the diagonal.