Tutorials
Building a model with MEDS: from the key design principles through data extraction, task definition, and model building.
What you'll build
Over these tutorials, you'll take the openly available MIMIC-IV demo dataset from raw tables to trained, evaluated models for one running prediction task: will a patient's ICU stay last longer than 3 days? Each step uses a tool from the MEDS ecosystem. A final step shows how to compare your models with community baselines in MEDS-DEV.
| Step | Page | What you'll do | Main tools |
|---|---|---|---|
| 1 | Getting Familiar with MEDS | Learn the MEDS data and metadata files on a small example dataset | The MEDS schema |
| 2 | Converting to MEDS | Convert the raw MIMIC-IV demo tables into MEDS | MEDS-Extract (built on MEDS-Transforms) |
| 3 | Extracting a Prediction Task | Turn the clinical question into a precise task definition and extract its labels | ACES |
| 4 | Pre-processing MEDS Data | Filter subjects and rare codes, remove outliers, and normalize the data | MEDS-Transforms (with MEDS-Reader shown as an option) |
| 5 | Build a Tabular Baseline | Build features, train a logistic-regression baseline, and evaluate it | scikit-learn, MEDS-Evaluation (with MEDS-Tab shown as the scalable alternative) |
| 6 | Build a Neural Network | Pre-process the data and train a neural network directly over MEDS data | MEDS TorchData, Lightning |
| 7 | Compare with MEDS-DEV | Relate your models to MEDS-DEV baselines, run them yourself, and contribute | MEDS-DEV |
Want to look at the data first? Visualizing and Exploring MEDS Data runs the tools for exploring a MEDS dataset on the same MIMIC-IV demo.
Steps 1, 2, 3, 5 and 6 were first featured in the MEDS tutorial at ML4H 2025; the others were added since.
How to follow along
- Just reading? The pages for steps 1–6 render their full notebooks, outputs included, so you can follow the whole tutorial without running anything.
- Want to run it? Use the "Open in Colab" link at the top of each notebook page, or run the notebooks locally. The notebooks of steps 1, 2, 3, 5 and 6 are in the ML4H 2025 tutorial repository; step 4's is in this website's repository.
- Start anywhere. Steps 3–6 begin by downloading the MIMIC-IV demo in MEDS format, and steps 5 and 6 also download the task labels produced in step 3, so you can jump straight to the step you care about.
- No credentialed data access needed. Everything uses the open-access MIMIC-IV demo.