1  The headline number

Here is a model. It was trained to flag a condition from a risk score, it has been evaluated on a held-out set of 2860 patients, and its performance is the one number every such model is eventually reduced to:

auroc(df$label, df$score)
[1] 0.8674829

An AUROC of about 0.87. That is a good model, comfortably better than a coin: the kind of number that clears a reviewer, anchors an abstract, and gets carried into a slide deck as the result. If the story stopped here, it would be a reassuring one.

1.1 The average is hiding its variance

The patients in this dataset are not interchangeable. They fall into three strata of very different size. Think of Fitzpatrick skin types on a dermatology model, where the darkest-skinned group is routinely under 5% of the training images. Ask the same question inside each stratum:

Group AUROC
I-II I-II 0.897
III-IV III-IV 0.855
V-VI V-VI 0.655

The single number was 0.87. Inside the smallest group it is 0.66: a different model, in effect, for the patients who were least present when it was built. The pooled figure is not wrong; it is dominated. The largest stratum sets the average, and the average then speaks confidently on behalf of a group it barely represents.

One pooled AUROC (dashed) against the three subgroup values it averages over. The gap widens as the group shrinks.

1.2 What this book does about it

Splitting the AUROC by subgroup is the first move, and the rest of this book is the argument that it is not nearly enough. A subgroup estimate is still just an estimate, and in a stratum of a few dozen events it can be wildly imprecise without looking it (Chapter 5). Discrimination (can the model rank patients) is only one of three questions, and the other two, whether its probabilities are calibrated (Chapter 6) and whether a single decision threshold serves every group (Chapter 7), are where transported models usually fail.

To make any of that trustworthy, we need an evaluation harness we can see all the way through. That is Chapters 3 and 4: a simulator whose answer we know, and an AUROC we wrote ourselves and can prove is right. First, though, we should be clear about what the three questions even are.