From cd8ee3c19cde2cb4f4ae5f23ef99a42295e59308 Mon Sep 17 00:00:00 2001 From: jhnwu3 Date: Thu, 1 Oct 2026 12:28:42 -0500 Subject: [PATCH] Add Tutorials page and fix stale Colab links - New tutorials.html: core API tutorials 0-7 (Colab, video, API docs, and source notebook in examples/tutorials/), the five end-to-end pipelines, and pointers to multimodal, examples/, and data-access notebooks. Linked from the homepage nav. - models.html: "Open Tutorial Notebook" pointed to a Drive notebook that is not public; now points to Tutorial 3 (pyhealth.models). - datasets.html, tasks.html, data/tasks.json: point to the canonical Tutorial 1/2 Colab notebooks listed in PyHealth docs/tutorials.rst instead of duplicate copies. Co-Authored-By: Claude Opus 5.5 --- data/tasks.json | 28 +-- datasets.html | 2 +- index.html | 1 + models.html | 2 +- tasks.html | 2 +- tutorials.html | 551 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 569 insertions(+), 17 deletions(-) create mode 100644 tutorials.html diff --git a/data/tasks.json b/data/tasks.json index 7c56af4..83aa4d3 100644 --- a/data/tasks.json +++ b/data/tasks.json @@ -83,7 +83,7 @@ "MIMIC-IV" ], "description": "Predict onset of diabetic ketoacidosis (DKA) from clinical event sequences in ICU patients.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.dka.html", "source_file": "pyhealth/tasks/dka.py", "modality": [ @@ -108,7 +108,7 @@ "TUAB" ], "description": "Classify clinical EEG recordings as normal or abnormal using deep signal models.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.temple_university_EEG_tasks.html", "source_file": "pyhealth/tasks/temple_university_EEG_tasks.py", "modality": [ @@ -157,7 +157,7 @@ "COSMIC" ], "description": "Classify genomic variants as pathogenic or benign using sequence-based features.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.MutationPathogenicityPrediction.html", "source_file": "pyhealth/tasks/variant_classification.py", "modality": [ @@ -182,7 +182,7 @@ "TCGA-PRAD" ], "description": "Predict 5-year survival of prostate cancer patients from multi-omics profiles.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.CancerSurvivalPrediction.html", "source_file": "pyhealth/tasks/cancer_survival.py", "modality": [ @@ -207,7 +207,7 @@ "MIMIC-III" ], "description": "Determine whether two clinical records belong to the same patient across fragmented health systems.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks.html", "source_file": "pyhealth/tasks/patient_linkage_mimic3.py", "modality": [ @@ -241,7 +241,7 @@ "MIMIC-III" ], "description": "Predict ICU length of stay as one of multiple duration buckets from admission data.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.length_of_stay_prediction.html", "source_file": "pyhealth/tasks/length_of_stay_prediction.py", "modality": [ @@ -267,7 +267,7 @@ "SleepEDF" ], "description": "Classify 30-second EEG epochs into Wake, N1, N2, N3, or REM sleep stages.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.SleepStagingSleepEDF.html", "input_schema": { "signal": "tensor" @@ -291,7 +291,7 @@ "TUEV" ], "description": "Classify EEG events into six types including spike-wave complexes, periodic discharges, and artifacts.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.temple_university_EEG_tasks.html", "source_file": "pyhealth/tasks/temple_university_EEG_tasks.py", "modality": [ @@ -363,7 +363,7 @@ "EHRShot" ], "description": "15-task few-shot benchmark suite for evaluating clinical foundation models on real-world EHR prediction challenges.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.benchmark_ehrshot.html", "input_schema": { "feature": "sequence" @@ -387,7 +387,7 @@ "MIMIC-III" ], "description": "Recommend a safe set of medications for a patient visit given their diagnosis and procedure history.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.drug_recommendation.html", "source_file": "pyhealth/tasks/drug_recommendation.py", "modality": [ @@ -437,7 +437,7 @@ "BMDHS" ], "description": "Classify cardiac valve disease conditions from phonocardiogram (PCG) heart sound recordings.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.bmd_hs_disease_classification.html", "source_file": "pyhealth/tasks/bmd_hs_disease_classification.py", "modality": [ @@ -495,7 +495,7 @@ "COSMIC" ], "description": "Predict functional impact and cancer driver gene status of somatic mutations.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.VariantClassificationClinVar.html", "source_file": "pyhealth/tasks/variant_classification.py", "modality": [ @@ -520,7 +520,7 @@ "eICU" ], "description": "Medication recommendation from multi-center ICU data with cross-site generalization evaluation.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.drug_recommendation.html", "source_file": "pyhealth/tasks/drug_recommendation.py", "modality": [ @@ -546,7 +546,7 @@ "TCGA-PRAD" ], "description": "Predict tumor mutation burden (TMB) as a continuous value from multi-omics cancer profiles.", - "colab_url": "https://colab.research.google.com/drive/1kKkkBVS_GclHoYTbnOtjyYnSee79hsyT?usp=sharing", + "colab_url": "https://colab.research.google.com/drive/1QB0acnGb-wOuK53UNSgHxjCW74QeYjUl?usp=sharing", "docs_url": "https://pyhealth.readthedocs.io/en/latest/api/tasks/pyhealth.tasks.CancerMutationBurden.html", "source_file": "pyhealth/tasks/cancer_survival.py", "modality": [ diff --git a/datasets.html b/datasets.html index e3c1762..2b1ead1 100644 --- a/datasets.html +++ b/datasets.html @@ -294,7 +294,7 @@

29 Clinical Datasets

A unified API for loading healthcare data across electronic health records, physiological signals, medical imaging, genomics, and clinical text — all ready for machine learning.

- + Open Tutorial Notebook diff --git a/index.html b/index.html index 2885a52..3279793 100644 --- a/index.html +++ b/index.html @@ -649,6 +649,7 @@ Datasets Tasks Models + Tutorials Roadmap Blog Join Us diff --git a/models.html b/models.html index f3c4be6..576f928 100644 --- a/models.html +++ b/models.html @@ -316,7 +316,7 @@

50 Clinical ML Models

Production-ready models spanning EHR sequence learning, drug recommendation, biosignal analysis, graph neural networks, medical imaging, and clinical NLP — all with a unified training API.

- + Open Tutorial Notebook diff --git a/tasks.html b/tasks.html index 4079faa..022256f 100644 --- a/tasks.html +++ b/tasks.html @@ -342,7 +342,7 @@

… Clinical Tasks

Standardized clinical prediction task definitions — from mortality and readmission to drug recommendation, sleep staging, and genomic analysis. Call dataset.set_task() and you're ready to train.

- + Open Tutorial Notebook diff --git a/tutorials.html b/tutorials.html new file mode 100644 index 0000000..ef9d2c7 --- /dev/null +++ b/tutorials.html @@ -0,0 +1,551 @@ + + + + + + PyHealth Tutorials + + + + + + + + + + + +
+ + +
+

PyHealth Tutorials

+

Learn PyHealth in Colab

+

Runnable notebooks that walk through each PyHealth module, then put them together into complete clinical ML pipelines. Most run on public or synthetic data, so you can start without credentialed access.

+ +
+ + +
+

Core API Tutorials

+

One notebook per module, in the order data flows through PyHealth: data → datasets → tasks → models → trainer → metrics.

+
+ +
+
+ 1 +
+

Loading Datasets

+ pyhealth.datasets +
+
+

Load MIMIC-III and COVID19-CXR, explore events efficiently, and see how to define and contribute your own dataset with a YAML config.

+ +
+ + +
+
+ 4 +
+

Training End to End

+ pyhealth.trainer +
+
+

Train an RNN for mortality prediction on synthetic MIMIC-III (no credentials needed): splits, early stopping, checkpoints, and inference.

+ +
+
+
+ 5 +
+

Evaluation Metrics

+ pyhealth.metrics +
+
+

Binary, multiclass, and multilabel metrics, plus fairness metrics such as disparate impact, and how to get raw predictions from the trainer.

+ +
+
+
+ 6 +
+

Tokenizing Codes

+ pyhealth.tokenizer +
+
+

Build a Vocabulary and Tokenizer, then encode flat code lists (2D) and visit-level histories (3D) with padding and truncation.

+ +
+
+
+ 7 +
+

Medical Code Ontologies

+ pyhealth.medcode +
+
+

Look up ICD, ATC, and CCS codes, walk code hierarchies with InnerMap, and translate between systems with CrossMap.

+ +
+
+

The videos are recordings from PyHealth Live sessions on the earlier 1.x API. The concepts carry over, but follow the notebooks for current code.

+
+ + +
+

End-to-End Pipelines

+

Complete workflows that load a dataset, define a task, train a model, and evaluate it. Each one runs on public Kaggle data, an open MIMIC demo, or synthetic MIMIC-III, so no credentialed access is needed to try them.

+
+
+
+

Chest X-ray Classification

+ Image +
+

Classify chest X-rays from the public COVID-19 Radiography Database, from download through training and evaluation.

+
COVID19CXRDatasetTorchvisionModel
+ +
+
+
+

Medical Coding

+ Text +
+

Predict ICD-9 codes from clinical notes in synthetic MIMIC-III, fine-tuning Bio_ClinicalBERT.

+
MIMIC3DatasetTransformersModel
+ +
+
+
+

Medical Transcription Classification

+ Text +
+

Classify Kaggle medical transcriptions by specialty with a pretrained transformer.

+
MedicalTranscriptionsDatasetTransformersModel
+ +
+
+
+

Mortality Prediction

+ EHR +
+

Predict mortality on the open MIMIC-III demo from diagnosis, procedure, and drug codes across visits.

+
MIMIC3DatasetRNN
+ +
+
+
+

Readmission Prediction

+ EHR +
+

Predict 30-day readmission on the public MIMIC-IV demo with Readmission30DaysMIMIC4.

+
MIMIC4DatasetRNN
+ +
+
+
+ + +
+

Go Further

+
+
+

Multimodal & Smart Processors

+

Put a HuggingFace tokenizer inside TupleTimeTextProcessor and train MLP, Transformer, and RNN models on mixed codes and clinical text.

+ +
+
+

Example Scripts by Task

+

Mortality, readmission, drug recommendation, sleep staging, chest X-ray, interpretability, and more. Not every script has been updated for PyHealth 2.0 yet.

+ +
+
+

Getting Data Access

+

Which datasets are public, which need PhysioNet credentialing, and how to download each one.

+ +
+
+
+ +
+ + + + + +