Auditing and Enforcing Calendar-Shift Invariance in Clinical Prediction Models
Abstract
Reliable patient trajectory models should produce clinical forecasts that remain unchanged when only an arbitrary calendar origin changes. Public clinical datasets often shift patient dates for privacy, preserving elapsed times but changing weekdays. We audit this dependence by evaluating the same patient histories under equivalent calendar shifts while holding model weights and scoring fixed. In AACR Project GENIE non small cell lung cancer data, the average patient’s log score varies by 0.098 nats per completed gap across equivalent shifts while the pooled cohort score remains nearly unchanged. Relative-phase uses timing differences within each patient’s history to remove this dependence while improving held out log scores over Absolute-phase. We also introduce X-align, a shift invariant feature that measures how well possible assessment dates match each patient’s prior assessment pattern. Against a baseline already using weekly timing features, X-align assigns 9.5% higher geometric-mean probability to observed assessment days in non small cell lung cancer and 12.1% higher in colorectal cancer, with positive effects at every held out hospital and scores unchanged across shifts. External glucose audits show the same problem. After synthetic date conversion, a calendar shift changes the predicted glucose category of an average 56% of each patient’s forecasts from a published NHiTS model, which randomized training anchors reduce to 0.42%, and a relative calendar origin eliminates high-glucose classification changes affecting 19.7% of CGMacros patients. Weekly timing information can improve prediction without making patient level predictions depend on an arbitrary calendar origin.