-
Notifications
You must be signed in to change notification settings - Fork 555
[PyHealth2.0 Bounty] MIMIC3 Readmission Prediction #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[PyHealth2.0 Bounty] MIMIC3 Readmission Prediction #751
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it might be easier to use the mimic3demo dataset, itself in test-resources/ . You may need to expand these test.csv files in this directory though with more patients/specific attributes, as they're a subset of the actual mimic3demo for speed purposes:
https://github.com/sunlabuiuc/PyHealth/tree/master/test-resources/core/mimic3demo
MIMIC3demo download:https://physionet.org/content/mimiciii-demo/1.4/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhnwu3 Are you wanting to keep test-resources/core/mimic3demo as a subset of the real demo dataset or do you mind if I add fake entries?
If I create fake entries, it would allow me to precisely test corner cases, but I'm sure I could probably find existing entries to get 90% of the test coverage I'm currently getting, which is probably plenty.
Overview
This PR updates the
readmission_prediction_mimic3_fnfor 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
ReadmissionPredictionMIMIC3task has the following improvements. First, it takes adatetime.timedeltainstead of anintfor 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,
ReadmissionPredictionMIMIC3should be logically equivalent toreadmission_prediction_mimic3_fn.Testing
I added unit tests for
ReadmissionPredictionMIMIC3and updated and ranexamples/readmission_mimic3_rnn.py.I also updated
examples/readmission_mimic3_fairness.py, but it doesn't run asfairness_metrics_fnwas 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'm curious what you think of the new
MockMICIC3Datasetclass I created for the unit tests. Would that be helpful elsewhere to keep the unit test run times short (instead of using the demo datasets)?I considered keeping
readmission_prediction_mimic3_fnas a wrapper aroundReadmissionPredictionMIMIC3for 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.