Skip to content

Conversation

@EricSchrock
Copy link
Collaborator

@EricSchrock EricSchrock commented Dec 24, 2025

Overview

This PR updates the readmission_prediction_mimic3_fn for PyHealth 2.0. I'll complete the readmission prediction tasks for the other datasets once this PR merges. This early PR should make that next PR go more smoothly.

In addition to supporting PyHealth 2.0, the new ReadmissionPredictionMIMIC3 task has the following improvements. First, it takes a datetime.timedelta instead of an int for the readmission window, making the input parameter clearer and more flexible. Second, it can optionally exclude visits where the patient was under 18 years old (a previously unimplemented #todo).

Besides the items listed above, ReadmissionPredictionMIMIC3 should be logically equivalent to readmission_prediction_mimic3_fn.

Testing

I added unit tests for ReadmissionPredictionMIMIC3 and updated and ran examples/readmission_mimic3_rnn.py.

I also updated examples/readmission_mimic3_fairness.py, but it doesn't run as fairness_metrics_fn was disabled in #320.

Additional Notes

Apologies for all the whitespace changes in README.rst. My editor automatically removes trailing whitespace and I had to update a code snippet in that file. Let me know if you'd rather not merge the whitespace changes and I can undo them.

I considered keeping readmission_prediction_mimic3_fn as a wrapper around ReadmissionPredictionMIMIC3 for backwards compatibility (I saw #735 does this for the LoS tasks). However, I'm not sure the changes to the LoS tasks are actually backwards compatible. The new tasks return lists for conditions, procedures, and drugs. The old tasks used to return lists of lists for these items but now as pass throughs they just return lists. I'm not sure if that change in behavior would impact users of the old tasks.

@EricSchrock EricSchrock requested a review from jhnwu3 December 24, 2025 04:53
@Logiquo Logiquo added bounty Please see the bounty list in PyHealth Discord Server component: task Contribute a new task to PyHealth labels Dec 24, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only change to this file was to change the admission and discharge times for subject_id 10088's first admission such that the admission was less than 18 years after the subject's date of birth.

Copy link
Collaborator

@jhnwu3 jhnwu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks a lot!

@jhnwu3 jhnwu3 merged commit e076d1b into sunlabuiuc:master Dec 30, 2025
1 check passed
@EricSchrock EricSchrock deleted the pyhealth2.0-bounty-mimic3-readmission-prediction branch December 31, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bounty Please see the bounty list in PyHealth Discord Server component: task Contribute a new task to PyHealth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants