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.
12 positive and 12 negative examples; neither side is perfectly separated.
ROC curve
All negatives are the denominatorRanking summary across thresholds
Precision–recall curve
Predicted positives are the precision denominatorDifferent from trapezoidal PR area
Move the slider, step between score groups, or click either plot to select the nearest operating point.
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.
| Predicted + | Predicted − | |
|---|---|---|
| Actual + | 9TP | 3FN |
| Actual − | 3FP | 9TN |
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.
| Threshold | TP | FP | Recall | FPR | Precision |
|---|
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.