Skip to main content

MCGrad

Production-ready multicalibration

Key Features

State-of-the-Art Multicalibration

Best-in-class calibration quality across a vast number of segments.

Easy to Use

Familiar interface. Pass features, not segments.

Highly Scalable

Fast to train, low inference overhead, even on web-scale data.

Safe by Design

Likelihood-improving updates with validation-based early stopping.

Quickstart

Install

pip install mcgrad
View minimal code example
from mcgrad import methods
import pandas as pd
import numpy as np

# Prepare your data in a DataFrame
df = pd.DataFrame({
'prediction': np.array([...]), # Base model predictions
'label': np.array([...]), # Ground truth labels
'country': [...], # Categorical features
'content_type': [...], # defining segments
'surface': [...],
})

# Train MCGrad
mcgrad = methods.MCGrad()
mcgrad.fit(
df_train=df,
prediction_column_name='prediction',
label_column_name='label',
categorical_feature_column_names=['country', 'content_type', 'surface']
)

# Get multicalibrated predictions
calibrated_predictions = mcgrad.predict(
df=df,
prediction_column_name='prediction',
categorical_feature_column_names=['country', 'content_type', 'surface']
)

Citing MCGrad

MCGrad: Multicalibration at Web Scale

@inproceedings{tax2026mcgrad,
title = {{MCGrad: Multicalibration at Web Scale}},
author = {Tax, Niek and Perini, Lorenzo and Linder, Fridolin and Haimovich, Daniel
and Karamshuk, Dima and Okati, Nastaran and Vojnovic, Milan
and Apostolopoulos, Pavlos Athanasios},
booktitle = {Proceedings of the 32nd ACM SIGKDD Conference on
Knowledge Discovery and Data Mining V.1 (KDD 2026)},
year = {2026},
doi = {10.1145/3770854.3783954}
}