AI ATLASAn interactive field guide
Concept 05 / A misleading shortcut

Data leakage.

A model predicts whether a patient will return within 30 days. One tempting feature is recorded only after that outcome. Watch how it inflates the score—and what happens when the model is used on admission day.

Move the prediction through time

Fictional patient records; real browser-side model fitting.

01 / When do we need the answer?

Time matters
AdmissionDay 0
decision needed
DischargeDay 4
care completed
OutcomeDay 30
return known
Billing codeDay 35
late feature recorded
Admission

02 / The score that fooled us

Holdout performance
Admission-only features—
Valid comparison at decision time
Historical test with late code—
A look-ahead result
Same model, used on admission—
Late code missing → filled with zero
Historical recall—At 35% threshold
Admission recall—Same model, missing code
Late feature timeDay 35After the outcome

03 / Inspect individual patients

Select a fictional record
Selected patient——
—
Historical score—
At admission—