Skip to content
Grad Coach

Diagram · CC BY 4.0

ROC space diagram with four example classifiers

Four classifiers in ROC space, from better than chance to worse, with C reversed to C'.

The ROC space, with the four example prediction results A, B, C and C'. The horizontal axis is the false positive rate, FPR = FP / (FP + TN), which equals 1 − specificity. The vertical axis is the true positive rate, TPR = TP / (TP + FN), which equals sensitivity.
ROC space with four example classifiers. Derek Jansen, Grad Coach, CC BY 4.0.

What it shows

ROC space is the unit square in which every point of an ROC curve lies. The horizontal axis is the false positive rate and the vertical axis the true positive rate, so the top-left corner represents a classifier with no misses and no false alarms.

Four example results are plotted from their contingency tables. A is better than chance, B lies on the diagonal and is no better than guessing, and C is worse than chance. C' is C with every prediction reversed.

How to read it

  1. The dashed diagonal is random guessing. Points in the shaded half above it are better than chance; points below it are worse.

  2. Each point is labeled with its coordinates, false positive rate first and true positive rate second.

  3. C and C' are reflections of each other through the center point, (0.5, 0.5), marked with an open circle.

  4. The point (0, 1) is perfect classification.

The numbers behind it

  • Each point comes from a table of 100 positive and 100 negative cases.
  • A: TP 63, FN 37, FP 28, TN 72, so FPR = 0.28 and TPR = 0.63.
  • B: TP 77, FN 23, FP 77, TN 23, so FPR = 0.77 and TPR = 0.77.
  • C: TP 24, FN 76, FP 88, TN 12, so FPR = 0.88 and TPR = 0.24.
  • C': TP 76, FN 24, FP 12, TN 88, so FPR = 0.12 and TPR = 0.76.
  • FPR = FP / (FP + TN), which is 1 − specificity. TPR = TP / (TP + FN), which is sensitivity.

Ways to use it in teaching

  • Give students the four contingency tables and have them plot the points before showing the figure.

  • C and C' illustrate that a classifier worse than chance still carries information.

  • Introduce it ahead of the ROC curve, so the axes are familiar when the curve appears.

Sources

Fawcett, T. (2006), "An introduction to ROC analysis", Pattern Recognition Letters 27(8): 861–874, doi:10.1016/j.patrec.2005.10.010 (ROC space, the diagonal, and reversing a worse-than-random classifier). The four contingency tables are the worked example in Wikipedia's Receiver operating characteristic article, section "ROC space".

Statistics

Related diagrams

All open educational resources