Testing a model across changes in the data-collection setting

← Back to Blog & Articles

A model trained at hospital A is deployed at hospital B, which has a different patient mix, a laboratory with a different offset on creatinine, a different assay for the biomarker and a higher baseline hazard.

Ch. 5 statistical evaluation and distribution shift treats the general theory; here we measure what happens to the quantities of this article.

Discrimination is unchanged: Harrell C is 0.6909 at hospital A and 0.6957 at B. Calibration is not. The mean predicted 12-month risk is 0.3131 at B, while the true event rate is 0.3872, so the observed-to-expected ratio is 1.2344 (1.0491 at A). The oracle ECE rises from 0.0126 to 0.0741 and the IPCW Brier score from 0.1386 to 0.2008. A model audited only on its ranking would look fine at B. Recalibrating by Platt scaling on 500 locally labelled patients (labels weighted for censoring) brings the ECE to 0.0247 and the mean risk to 0.3796.

For decisions, the effect shows up in net benefit. At pt=0.30p_t=0.30 the raw score has net benefit 0.1726 and the recalibrated score 0.1763, with treat-all at +0.1245. At pt=0.40p_t=0.40 the values are 0.1255 and 0.1297, against -0.0214 for treat-all. At pt=0.50p_t=0.50 they are 0.0860 and 0.0942 against -0.2257. The gains from recalibration are modest in absolute terms but consistent, and they occur without any change in the ranking. The conformal intervals suffer as well. Mondrian intervals calibrated at hospital A cover 0.863 of biomarker values at hospital B against a 90 percent target, since the assay offset moved the conditional distribution. Recalibrating the quantiles on the same 500 local patients gives 0.916. The exchangeability assumption of Ch. 2 conformal prediction fails across hospitals, and the guarantee fails with it; a local calibration set restores it.

Continue with the book

Explore the full treatment, worked examples, and exercises in Applied AI Under Uncertainty.


Companion article for Applied AI Under Uncertainty, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top