Tutorials
Interactive Jupyter notebooks demonstrating how to use MCGrad for multicalibration.
Available Tutorials
| Tutorial | Description | Launch |
|---|---|---|
| MCGrad Core Algorithm | Complete introduction to multicalibration with MCGrad |
What You'll Learn
01. MCGrad Core Algorithm
This comprehensive tutorial covers:
- Why Multicalibration Matters - Understand the limitations of global calibration and why segment-level calibration is important
- MCGrad Basics - Learn how to use the
fit()andpredict()API - Measuring Multicalibration - Use the Multicalibration Error (MCE) metric to evaluate calibration quality
- Visualization - Plot global and segment-level calibration curves
- Advanced Features - Explore feature importance, model serialization, numerical features, and custom hyperparameters
Running Tutorials
Option 1: Google Colab (Recommended)
Click the "Open in Colab" badge above to run tutorials directly in your browser. No local setup required!
Option 2: Local Jupyter
- Install MCGrad with tutorial dependencies:
pip install "MCGrad[tutorials] @ git+https://github.com/facebookincubator/MCGrad.git"
- Clone the repository and navigate to tutorials:
git clone https://github.com/facebookincubator/MCGrad.git
cd MCGrad/tutorials
jupyter notebook 01_mcgrad_core.ipynb
Option 3: VS Code
Open the .ipynb files directly in VS Code with the built-in Jupyter extension.
Contributing Tutorials
We welcome contributions! If you'd like to add a new tutorial:
- Create a new
.ipynbfile in thetutorials/directory - Follow the naming convention:
XX_descriptive_name.ipynb - Include a Colab setup cell at the top (see existing tutorials for the pattern)
- Add the tutorial to this documentation page
- Submit a pull request
See the Contributing Guide for more details.