Tutorials#
We provide the following tutorials to help users get started with our pyhealth. Please bear with us as we update the documentation on how to use pyhealth 2.0.
Tutorial 0: Introduction to pyhealth.data [Video]
Tutorial 1: Introduction to pyhealth.datasets [Video (PyHealth 1.6)]
Tutorial 2: Introduction to pyhealth.tasks [Video (PyHealth 1.6)]
Tutorial 3: Introduction to pyhealth.models [Video]
Tutorial 4: Introduction to pyhealth.trainer [Video]
Tutorial 5: Introduction to pyhealth.metrics [Video]
Data Access Guide#
For information on how to access and download the datasets supported by PyHealth, please refer to our Datasets Overview Notebook.
Additionally, for detailed tutorials on accessing PhysioNet and MIMIC datasets, see the Getting MIMIC access section of the DL4H course instructions.
Tutorials on Building Task Pipelines#
The following tutorials will help users build their own task pipelines. [Video]
Pipeline 1: Chest Xray Classification
Pipeline 3: Medical Transcription Classification
Additional Examples#
Warning
Compatibility Notice: Not all examples below have been updated to PyHealth 2.0. However, they remain useful references for understanding workflows and implementation patterns. If you encounter compatibility issues, please refer to the tutorials above or consult the updated API documentation.
The examples/ directory contains additional code examples demonstrating various tasks, models, and techniques. These examples show how to use PyHealth in real-world scenarios.
Browse all examples online: https://github.com/sunlabuiuc/PyHealth/tree/master/examples
Mortality Prediction#
Example File |
Description |
|---|---|
|
RNN for mortality prediction on MIMIC-III |
|
StageNet for mortality prediction on MIMIC-III |
|
AdaCare for mortality prediction on MIMIC-III |
|
Agent model for mortality prediction on MIMIC-III |
|
ConCare for mortality prediction on MIMIC-III |
|
GRASP for mortality prediction on MIMIC-III |
|
Temporal Convolutional Network for mortality prediction |
|
StageNet for mortality prediction on MIMIC-IV (v2) |
Readmission Prediction#
Example File |
Description |
|---|---|
|
RNN for readmission prediction on MIMIC-III |
|
Fairness-aware readmission prediction on MIMIC-III |
Survival Prediction#
Example File |
Description |
|---|---|
|
Survival probability prediction preprocessing with SUPPORT2 dataset. Demonstrates feature extraction (demographics, vitals, labs, scores, comorbidities) and ground truth survival probability labels for 2-month and 6-month horizons. Shows how to decode processed tensors back to human-readable features. |
Drug Recommendation#
Example File |
Description |
|---|---|
|
SafeDrug for drug recommendation on MIMIC-III |
|
MoleRec for drug recommendation on MIMIC-III |
|
GAMENet for drug recommendation on MIMIC-III |
|
Transformer for drug recommendation on MIMIC-III |
|
MICRON for drug recommendation on MIMIC-III |
|
GAMENet for drug recommendation on MIMIC-IV |
|
RETAIN for drug recommendation on MIMIC-IV |
|
Transformer for drug recommendation on eICU |
EEG and Sleep Analysis#
Example File |
Description |
|---|---|
|
ContraWR for sleep staging on SleepEDF |
|
ContraWR for sleep staging on SHHS |
|
SparcNet for sleep staging on ISRUC |
|
SparcNet for EEG event detection |
|
SparcNet for EEG abnormality detection |
|
SparcNet for cardiology arrhythmia detection |
Image Analysis#
Example File |
Description |
|---|---|
|
Conformal prediction for COVID-19 CXR classification |
|
CNN for chest X-ray classification (notebook) |
|
VAE for chest X-ray image generation |
|
GAN for chest X-ray image generation (notebook) |
Interpretability#
Example File |
Description |
|---|---|
|
Integrated Gradients for StageNet interpretability |
|
DeepLift attributions for StageNet on MIMIC-IV |
|
Evaluating attribution methods with metrics |
|
Interactive interpretability demonstrations (notebook) |
Patient Linkage#
Example File |
Description |
|---|---|
|
MedLink for patient record linkage on MIMIC-III |
Advanced Topics#
Example File |
Description |
|---|---|
|
RNN for length of stay prediction |
|
Working with OMOP Common Data Model |
|
Medical code vocabulary and mappings |
|
EHRShot benchmark with XGBoost (notebook) |
Notebooks (Interactive)#
Notebook File |
Description |
|---|---|
|
Comprehensive StageNet tutorial |
|
Cached mortality prediction workflow |
|
Time series analysis on MIMIC-IV |
|
Transformer models on MIMIC-IV |
|
CNN models on MIMIC-IV |
|
Graph Attention Networks on MIMIC-IV |
|
Graph Convolutional Networks on MIMIC-IV |
|
SafeDrug interactive notebook |
|
MoleRec interactive notebook |
|
MICRON interactive notebook |
|
Knowledge graph embeddings |
|
Language model embeddings with HuggingFace |
|
Language model embeddings with OpenAI |
|
Data preprocessing and mapping utilities |
|
Using Torchvision models with graph data |