Skip to content

Fix post-outcome data leakage in StageNet mortality/LOS tasks - #1205

Open
lehendo wants to merge 1 commit into
sunlabuiuc:masterfrom
lehendo:stagenetfix
Open

Fix post-outcome data leakage in StageNet mortality/LOS tasks#1205
lehendo wants to merge 1 commit into
sunlabuiuc:masterfrom
lehendo:stagenetfix

Conversation

@lehendo

@lehendo lehendo commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  • MortalityPredictionStageNetMIMIC4: exclude diagnosis/procedure codes for the admission that ends in death, and cap that admission's labs to the first 48 hours after admission instead of through discharge. Earlier, already-resolved admissions are unaffected
  • LengthOfStayStageNetMIMIC4: same treatment for the target admission (the one whose LOS is the label)

diagnoses_icd/procedures_icd events are timestamped at dischtime (per
the MIMIC-IV config), so for the admission whose own outcome is being
predicted, those codes are only known at-or-after the outcome. Labs
were also pulled through discharge/death for that same admission.

- MortalityPredictionStageNetMIMIC4: exclude diagnosis/procedure codes
  for the admission that ends in death, and cap that admission's labs
  to the first 48 hours after admission instead of through discharge.
  Earlier, already-resolved admissions are unaffected.
- LengthOfStayStageNetMIMIC4: same treatment for the target admission
  (the one whose LOS is the label).

Both changes only affect the single outcome-adjacent admission per
patient; prior history is untouched. Reported metrics on these two
tasks are expected to drop after this fix -- the previous numbers were
inflated by the leak, not a legitimate baseline.

Verified end-to-end against real MIMIC-IV demo data: terminal/target
admission codes are excluded, late labs near the outcome are dropped,
early labs and all prior-admission data are preserved, and patients
whose only admission is the terminal/target one are correctly excluded
(no leak-free signal available), matching the existing convention in
dka.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant