Welcome to this hands-on workshop on AI Model Calibration, a fundamental aspect of developing reliable and trustworthy machine learning systems. Through practical exercises and real-world examples, you'll master the art of calibrating your models to ensure their probability predictions accurately reflect real-world outcomes.
After completing this workshop, you will be able to:
- Understand why model calibration is crucial for trustworthy AI systems
- Master various calibration techniques including:
- Platt Scaling
- Isotonic Regression
- Venn-Abers
- Apply these techniques to real-world datasets
- Assess calibration quality using:
- Reliability diagrams
- Brier Score
- Expected Calibration Error (ECE)
- Make informed decisions about when and how to calibrate your models
The workshop is organized around progressive tutorials that build your understanding of model calibration, it designed to suit learners of all levels.
- The workshop is divided into three progressive stages:
stage_1: Binary classification calibrationstage_2: Multi-class calibration challengesstage_3: Multi-label calibration scenarios
Start with the
mainbranch to understand the theoretical foundations. Choose your challenge level based on your experience with machine learning and probability theory. Feel free to start with thehardbranch if you're up for a challenge. If it gets tricky, switch tointermediateoreasyfor progressive hints.
| Branch | Purpose |
|---|---|
main |
Core concepts and theoretical foundations of model calibration |
easy |
Beginner-friendly version with step-by-step guidance |
intermediate |
Standard version with partial implementation guidance |
hard |
Advanced challenges for experienced practitioners |
correction |
Complete solutions with detailed explanations |
Recommendation: Start with the
mainbranch to grasp the theoretical foundations. Choose your subsequent branch based on your experience level. Feel free to start with thehardbranch if you're up for a challenge. If it gets tricky, switch tointermediateoreasyfor progressive hints. Even if you're experienced, theeasybranch can provide valuable insights into best practices.
The workshop materials are organized as follows:
- Core Components:
data/: Curated datasets for training and validation exercisessrc/calibration/: Marimo notebooks containing step-by-step tutorials and hands-on examplesplots/: Visual aids including reliability diagrams, calibration curves, and performance metricsTODO.md: Detailed instructions and learning milestones for each stage
The correction branch provides complete implementations and detailed explanations
This workshop offers different difficulty levels to match your learning pace. To switch between levels:
git checkout <branch-name>Replace <branch-name> with one of the following :
main→ basic explanation and introductioneasy→ Step-by-step versionintermediate→ standard levelhard→ advanced versioncorrection→ Complete solution
Choose your preferred environment to complete this workshop:
If you're comfortable working locally, simply clone the repository and follow the common instructions above.
- Clone the repository
- Install the Python package manager
uv:curl -LsSf https://astral.sh/uv/install.sh | sh
If the uv installation fails or you're having trouble with your virtual environment, you can try running the workshop in the cloud using GitHub Codespaces instead.
- Install dependencies:
uv sync
- Activate the virtual environment:
source .venv/bin/activate
Note : If you encounter issues with
uvor virtual environments, you can try running the workshop in the cloud using GitHub Codespaces instead (option 2).
For a zero-installation experience directly in your browser:
- Go to the repository on GitHub
- Select your desired branch (
main,easy, etc.) - Click the green "Code" button → "Create codespace"
- Once the Codespace loads, run:
You're now ready to start coding!
uv sync source .venv/bin/activate
Important: Each Codespace is tied to the branch you selected when creating it. To switch branches, go back to GitHub, select the new branch, and click on the + icon in the top right corner to create a new Codespace for that branch then repeat step 4.
You're now all set — pick your branch, open the tutorial, and start exploring model calibration!

