A classifier that outputs scores isn't one classifier — it's a whole family of them, one per threshold you might pick. The ROC curve plots what happens across all of them at once.
At each threshold, everything scoring >= t is called positive, and you record two rates:
= TP / (TP + FN) — of the real positives, how many did you catch?= FP / (FP + TN) — of the real negatives, how many did you wrongly flag?Task: write roc_points(y_true, scores) where y_true holds 0/1 labels. Return a list of [fpr, tpr] pairs, each rounded to 4 decimal places, built exactly like this:
[0.0, 0.0] — the threshold above every score, where nothing is predicted positive.[fpr, tpr] pair per threshold.The word unique is doing real work. Tied scores are indistinguishable to the model — it cannot separate them, so they must all cross the threshold together as a single step, not one at a time.
0.0; if there are no negatives, treat FPR as 0.0.