ACKLEY WILL · VISUAL LEARNING

ROC & Precision–Recall Explorer

One set of scores, two views. Change the threshold, follow the operating point and inspect the counts. All data and calculations are included in this file; no internet connection or installation is needed.

02 / One ranking, two views
0.50
Positive means score ≥ threshold.
Walk through the ranking

12 positive and 12 negative examples; neither side is perfectly separated.

ROC curve

All negatives are the denominator
0.792ROC AUC · trapezoidal area
Ranking summary across thresholds

Precision–recall curve

Predicted positives are the precision denominator
0.792Average precision · recall-weighted steps
Different from trapezoidal PR area
Score rankingCurrent thresholdReference line

Move the slider, step between score groups, or click either plot to select the nearest operating point.

Current operating point12 of 24 predicted positive
25.0%False-positive rate
75.0%Recall / true-positive rate
75.0%Precision

TP 9 · FP 3 · FN 3 · TN 9

Connect the point to the decisions

Recall uses the actual positive row. Precision uses the predicted positive column. The ROC x-axis uses the actual negative row.

Confusion matrix · current threshold
Predicted +Predicted −
Actual +9TP3FN
Actual −3FP9TN

One threshold moves a point

The full curves depend on scores and true labels. Moving the threshold changes the highlighted decisions; it does not change ROC AUC or average precision.

Rare positives change the picture

The ROC diagonal is a random-ranking reference. The dashed PR line marks the positive share of this dataset: 50.0%. Try “Rare positives” and inspect how many alerts are correct.

Inspect the threshold groups and calculation

Equal scores move together. The sweep starts above the largest score and ends below the smallest. Average precision adds precision × increase in recall; ROC AUC uses trapezoids. At no positive predictions, precision is undefined; the PR drawing uses (recall 0, precision 1) as a display convention.

ThresholdTPFPRecallFPRPrecision
Discuss

Would a high ROC AUC alone tell you how many of your positive alerts are correct? What extra information does the PR view reveal?

Synthetic datasets only. These are binary, unweighted curves. AUC and average precision summarize rankings; neither selects the right threshold or estimates deployment costs.