feat(tasks): add medical mistrust tasks for MIMIC-III (Boag et al. 2018)#961
Open
vtewari2 wants to merge 1 commit intosunlabuiuc:masterfrom
Open
Conversation
Add two binary classification tasks and a helper that reproduce the
interpersonal-feature mistrust classifiers from:
Boag et al. "Racial Disparities and Mistrust in End-of-Life Care."
MLHC 2018. arXiv:1808.03827
New file: pyhealth/tasks/mistrust_mimic3.py
- build_interpersonal_itemids(d_items_path): reads D_ITEMS.csv.gz and
returns {itemid: label} for ~168 interpersonal CHARTEVENTS items
matched via keyword list from trust.ipynb.
- MistrustNoncomplianceMIMIC3: predicts "noncompliant" label from
NOTEEVENTS using interpersonal CHARTEVENTS features as a sequence
input. Label 1 = noncompliant (mistrustful), 0 = compliant.
- MistrustAutopsyMIMIC3: predicts autopsy consent from the same
features. Label 1 = consent (mistrustful), 0 = decline (trusting).
Admissions with both consent and decline signals are excluded.
- Full feature normalisation mirroring trust.ipynb cell 7 (restraint
coarsening, bath categories, skip rules for pain mgmt/type/cause).
Updated: pyhealth/tasks/__init__.py
- Export MistrustNoncomplianceMIMIC3, MistrustAutopsyMIMIC3,
build_interpersonal_itemids.
Co-Authored-By: Varun Tewari <vtewari2@illinois.edu>
This was referenced Apr 11, 2026
Open
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.
Description:
Summary
Adds two binary classification tasks and a helper function that implement
the computational mistrust proxies from:
Both tasks extract interpersonal interaction features from
CHARTEVENTS(structured, ~168 binary features covering agitation scales, restraints,
education readiness, family communication, pain assessments, etc.) and derive
binary labels from free-text
NOTEEVENTS, one admission at a time.Background
The paper identifies medical mistrust — a historically grounded institutional
skepticism prevalent in minority communities — as a primary driver of racial
disparities in aggressive end-of-life care. It quantifies mistrust through
three algorithmic proxies; this PR implements the two supervised classifiers:
"noncompliant"substring in any noteBoth use the same
interpersonal_featuresinput — a deduplicated sequenceof normalised CHARTEVENTS feature-key strings — compatible with
LogisticRegression(and any other PyHealth sequence model).New:
pyhealth/tasks/mistrust_mimic3.pybuild_interpersonal_itemids(d_items_path)Helper that reads
D_ITEMS.csv.gzand returns{itemid: label}for allCHARTEVENTS items whose label matches the ~40 interpersonal keywords from
the paper's
trust.ipynb. Produces ~168 matched ITEMIDs on MIMIC-III v1.4.