Prediction sets

A patient has just left hospital. We want to know whether they will be back within 30 days. A model can give a percentage. This lesson is about a more honest report of that percentage: sometimes the only fair answer is that we cannot tell.

The usual report is always yes or no

Suppose the model says 12%. If your rule is “treat anyone above 20% as a likely return,” this person is labelled will not return. At 93% they are labelled will return. That is ordinary thresholding, and it is what most clinical models do.

Now take someone at 52%. The model is close to a coin toss, but the same rule still forces one label. You have not gained knowledge. You have only hidden the uncertainty.

A prediction set is a short list of what has not been ruled out

We keep the same percentage. We do not retrain the model. We only decide which of the two 30-day outcomes still look plausible. Meet three made-up people from a fictional ward. The only question is: did they come back within 30 days?

Aisha · about 6% predicted
Will not return

Her score is low. The list contains only “will not return.” The method has ruled out a 30-day return.

Tom · about 52% predicted
Unsure

His score is in the middle. The list still contains both outcomes. Unsure means “do not pretend.” It is not a treatment plan.

Elena · about 93% predicted
Will return

Her score is high. The list contains only “will return.” The method has ruled out staying away.

You also choose how often the true outcome should still be on that list, for example 90% of the time. That number is a target, not a guarantee. To get closer to it, more people have to look like Tom. If you later use the same cutoff where more people actually return, the 90% can collapse.

Watch Aisha, Tom, Elena, and nine others

The counts are for 240 made-up test patients. The cards are 12 of them, including Aisha, Tom, and Elena. A second group of 240 was used only to set the cutoff. Nothing here is a real record.

Move the slider first. Cards should change column. Then click New hospital: the cards stay put, because the percentages did not change, but more of them will be marked as missed.

95% pulls more people into Unsure. 75% gives more firm labels and more misses.
Where did these 240 people come from?
True outcome still on the list
Left Unsure, or with an empty list
True outcome was ruled out by mistake

All 240 test patients

Where the cutoff sits on predicted risk

The middle band is Unsure. It should get wider as you ask for 95%.

0%Predicted chance of a 30-day return100%

The same 12 people, grouped by their current list

Two questions

1. You move the slider from 75% to 95%. Tom’s predicted 52% does not change. What happens?

2. You keep 90% and switch to the new hospital. Should about 90% of true outcomes still be on the list?

This is not a clinical decision

The list does not tell you who to call or admit. 90% is an average over people, not a certificate for one ward or one patient. Aisha getting a short list does not mean the model is safe.

Related pages: calibration and thresholds, external validation, clinical workflow.

How the cutoff is chosen

This is split conformal prediction. For each possible 30-day outcome we score how surprising it would be: 1 − model probability of that outcome. On 240 separate people we score the outcome that actually happened, sort those scores, and take the ceil((240 + 1) × target)th smallest. Call that value q. For a new person, “will not return” stays on the list if predicted risk ≤ q, and “will return” stays on the list if 1 − risk ≤ q.

If q is above one half, people like Tom are Unsure. If you lower the target enough that q drops below one half, people in the middle can get an empty list. That is the method being too strict, not a diagnosis. The 90% figure only applies while new patients look like the people used to set the cutoff. Even then, 240 test patients can land a little below 90% by chance.

The model here uses one made-up feature and a fixed logistic score. On New hospital the features stay the same and the true chance of return is shifted up.

Reading: Angelopoulos and Bates, A Gentle Introduction to Conformal Prediction; Barber et al., Conformal Prediction Beyond Exchangeability.