Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Visualizing PerformanceAUC: Area Under the Curve

Reading time: ~10 min

Comparing whole curves is useful, but often you want one number. The AUC is the area under the ROC curve. The graph is a 1 × 1 square, so the AUC is a number from 0 to 1. For the camp's test it is about 0.99:

A perfect test's curve fills the whole square, so its AUC is . A coin flip's curve is the diagonal, which cuts the square in half: AUC = . An AUC below 0.5 means the test does worse than tossing a coin.

Note

In calculus terms the AUC is a definite integral, \text{AUC} = \displaystyle\int_0^1 \text{TPR} \; d(\text{FPR}). An ROC curve from real data is a staircase, so this integral is simply a sum of rectangles.

Area as Pairs

Here is a surprise: the same area can be found by comparing pairs. Take three patients and five healthy people from the camp. Each square of the grid is one pair: a patient's score (purple) against a healthy person's score (blue).

Tap every square in which the patient scored higher.

The squares you shaded fill exactly the area under the ROC curve of these eight people. So the AUC has a second meaning:

AUC = the chance that a randomly chosen patient gets a higher score than a randomly chosen healthy person.

Pick a Random Pair

Let us check that on the whole camp. Its 10 patients and 190 healthy people make 10 × 190 = 1900 different pairs. Pick pairs at random and count how often the patient wins. Complete both missions.

The patient wins in 1878 of the 1900 possible pairs, and 1878 ÷ 1900 ≈ 0.99 — the area under the camp's curve. Counting pairs like this is how computers usually work out the AUC.

Sina