Skip to main content

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.

StepPageWhat you'll doMain tools
1Getting Familiar with MEDSLearn the MEDS data and metadata files on a small example datasetThe MEDS schema
2Converting to MEDSConvert the raw MIMIC-IV demo tables into MEDSMEDS-Extract (built on MEDS-Transforms)
3Extracting a Prediction TaskTurn the clinical question into a precise task definition and extract its labelsACES
4Pre-processing MEDS DataFilter subjects and rare codes, remove outliers, and normalize the dataMEDS-Transforms (with MEDS-Reader shown as an option)
5Build a Tabular BaselineBuild features, train a logistic-regression baseline, and evaluate itscikit-learn, MEDS-Evaluation (with MEDS-Tab shown as the scalable alternative)
6Build a Neural NetworkPre-process the data and train a neural network directly over MEDS dataMEDS TorchData, Lightning
7Compare with MEDS-DEVRelate your models to MEDS-DEV baselines, run them yourself, and contributeMEDS-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.