PyHealth Clinical Deep Learning Pipeline
Guides Claude to build clinical ML pipelines with PyHealth following the dataset → task → model → trainer → metrics pattern.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
PyHealth is a Python toolkit for clinical deep learning. This skill teaches Claude to write idiomatic PyHealth code that follows the library's 5-stage pipeline (Dataset → Task → Model → Trainer → Metrics).
- Dataset loading: MIMIC-III/IV, eICU, OMOP-CDM, EHRShot, SleepEDF, SHHS, ISRUC, ChestX-ray14, COVID19-CXR, TUEV/TUAB
- Task definition: mortality, readmission, length of stay, drug recommendation, sleep staging, ICD coding, EEG event detection, de-identification
- Model selection: Transformer, RETAIN, GAMENet, SafeDrug, MICRON, StageNet, AdaCare, CNN/RNN/MLP
- Training & evaluation: PyHealth
Trainerhandles checkpointing, logging and best-model selection; clinical metrics like PR-AUC, ROC-AUC, Jaccard - Medical code utilities: lookup and cross-mapping for ICD-9/10-CM, ATC, NDC, RxNorm, CCS
The most valuable part is the "critical things to get right" list — pass a SampleDataset (not BaseDataset) to models, always split by patient to avoid leakage, MIMIC-IV uses ehr_root=, and pick a monitor metric matching the task type.
Who it's for
- Healthcare AI researchers and grad students modeling EHR data from MIMIC/eICU
- Data scientists prototyping hospital risk-prediction models (mortality, readmission)
- Health informatics practitioners doing frequent ICD/ATC/NDC code mapping
- Anyone building signal or imaging classification pipelines (polysomnography, EEG, chest X-ray)
Example uses
- "Build a mortality prediction model on synthetic MIMIC-III in under 20 lines" → generates a script using the public synthetic bucket with
MortalityPredictionMIMIC3+Transformer+Trainer, and setsmonitor="pr_auc"correctly. - "Create a drug recommendation pipeline on MIMIC-IV and compare SafeDrug vs GAMENet" → uses multilabel-appropriate metrics (
jaccard_samples,pr_auc_samples) and avoids theehr_root=constructor gotcha. - "Map NDC codes in my prescription table to ATC level 3" → produces medcode-based NDC→RxNorm→ATC cross-mapping code.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pyhealth folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pyhealth/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/pyhealth ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and make sure the skills directory exists:
mkdir -p ~/.claude/skills - Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy the skill folder:
cp -r scientific-agent-skills/skills/pyhealth ~/.claude/skills/(keep the references/ and assets/ subfolders intact). - Set up Python. PyHealth 2.0 needs Python ≥ 3.12 and < 3.14:
uv init my-pyhealth-project && cd my-pyhealth-project && uv python pin 3.12 - Install the library:
uv add pyhealth(for the legacy line,uv add pyhealth==1.16). - Restart Claude Code and try a prompt like "Build a MIMIC-III mortality prediction pipeline with PyHealth" — the skill triggers automatically.
- Real MIMIC data requires credentialed PhysioNet access. While learning, use the public synthetic MIMIC-III bucket referenced in the skill.
View source on GitHub ↗License: MIT