Machine learning with football · Chapter 4 · Classification

ROC and AUC

Every threshold at once in one curve, and one number for how well the model ranks matches.

Estimated time: 10 minutes · page 4 of 7

Every threshold in one picture

Each threshold gives one recall (true positive rate) and one false positive rate. Plot both for every possible threshold and you get the ROC curve on the board, a name left over from radar operators in the Second World War. The dot is your threshold. Drag the slider and it slides along the curve.

The bottom left corner is a threshold of 100%, where nothing is called a home win. The top right is 0%, where every match is. A perfect model would shoot straight up to the top left corner, catching every home win before a single false alarm. A model that guesses would follow the dashed diagonal.

AUC

The area under the curve, AUC, squeezes the whole curve into one number. It has a neat football meaning: take one random home win and one random match without a home win. AUC is the chance the model gave the home win the higher score. 0.5 is a coin flip, 1.0 is perfect, and anything under 0.5 ranks matches the wrong way round.

Check yourself

Four models have these AUCs. Which ranks matches best?
Which of these models is worse than a coin flip?
How do you make that 0.32 model better than a coin flip without retraining it?
For the tipster, a false home win costs money and a missed one costs nothing. Which point on the ROC curve?

Picking a point

AUC helps you compare models, as long as the data is roughly balanced. The bigger the area, the better the ranking. To use a model you still need one threshold, and the curve shows the choices. Near the bottom left you get few false alarms and catch fewer home wins, which suits a tipster paying for every wrong call. Further up and right you catch nearly every home win and accept more false alarms. When both mistakes cost about the same, pick the point where the curve bends.

On imbalanced data a precision-recall curve, precision against recall at every threshold, tells you more than ROC does.

Terms on this page: AUC, ROC curve

Leagues