MIMIC-III AMA prediction task + examples + tests#987
Open
Madhav-Kanda wants to merge 8 commits intosunlabuiuc:masterfrom
Open
MIMIC-III AMA prediction task + examples + tests#987Madhav-Kanda wants to merge 8 commits intosunlabuiuc:masterfrom
Madhav-Kanda wants to merge 8 commits intosunlabuiuc:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributors
Type of contribution
task— newAMAPredictionMIMIC3task for against-medical-advice (AMA) discharge on MIMIC-III.examples+tests+docs(API documentation for the task).Paper (reproducibility)
Boag et al., Racial Disparities and Mistrust in End-of-Life Care, 3rd Machine Learning for Healthcare Conference, PMLR 85:587–602, 2018.
The AMA discharge setup in this PR follows MIMIC-III
discharge_locationand the demographic / administrative feature ablations discussed in that work.High-level description
This PR adds
AMAPredictionMIMIC3, a MIMIC-III task that predicts AMA discharge from administrative and demographic features only (gender + insurance, age, length of stay, optional normalized race, optional substance-use flag from admission diagnosis text). No ICD / prescription sequences are required for the task samples.It supports three ablation feature sets aligned with the paper’s AMA analysis:
demographics,age,losracehas_substance_useExamples
examples/mimic3_ama_prediction_logistic_regression.py— logistic regression ablation with AUROC, subgroup metrics (race, age band, insurance), and fairness-style reporting (demographic parity, equal opportunity). Includesgenerate_synthetic_mimic3for local CSVs:exhaustivecross-product coverage orrandomstochastic data; CLI flags--data-source(auto/synthetic/real),--synthetic-mode,--root,--patients,--seed, etc.examples/mimic3_ama_prediction_rnn.py— same data path and CLI pattern using an RNN; loads the synthetic generator from the logistic example viaimportlib.Tests
All AMA-related tests live in
tests/core/test_mimic3_ama_prediction.py: helpers / mocks, ablation sanity checks, syntheticMIMIC3Datasetpipeline tests, short training smoke tests, and an exhaustive synthetic row-count check.File guide (what to review)
pyhealth/tasks/ama_prediction.pypyhealth/tasks/__init__.pydocs/api/tasks.rst,docs/api/tasks/pyhealth.tasks.ama_prediction.rstexamples/mimic3_ama_prediction_logistic_regression.py,examples/mimic3_ama_prediction_rnn.pytests/core/test_mimic3_ama_prediction.pyContribution guide alignment (
CONTRIBUTING.md)CONTRIBUTING.md.How to verify