Contents
Figure 1: The structure is the explanation
Most teams accept a trade: simple models you can read, or powerful models you have to explain after the fact. Explainable Boosting Machines (EBMs) challenge that trade. They're glass-box models whose structure is the explanation, and on many tabular problems they come close to gradient-boosted trees in accuracy. If your model decides who gets a loan, a treatment, or a flag for review, they're worth knowing well. This guide covers how EBMs work, how to use them through the InterpretML library, and where they fall short.
What an EBM Actually Is
An EBM is a generalized additive model (GAM) trained with modern machine learning techniques. A classic GAM predicts using a sum of one-variable functions:
g(prediction) = intercept + f₁(x₁) + f₂(x₂) + … + fₙ(xₙ)
Each fᵢ is a shape function that shows exactly how feature i moves the prediction, independent of the others. Because the effects add up, you can plot each function and read the model directly — the same one-feature-at-a-time reading you get from partial dependence plots, except here it's the model itself rather than a probe of it. Traditional GAMs fit those shapes with splines. EBMs fit them with boosted trees instead. InterpretML describes EBM as an interpretable model developed at Microsoft Research that uses bagging, gradient boosting, and automatic interaction detection to breathe new life into traditional GAMs.
Three ingredients matter:
- Cyclic boosting: the algorithm trains on one feature at a time, round-robin, using very small learning steps, so each feature's shape is learned without being swallowed by correlated neighbors.
- Bagging: repeated fits on resampled data smooth the shapes and provide uncertainty estimates you'll see as bands on the plots.
- Automatic pairwise interactions: after the main effects, the algorithm detects and adds two-feature terms (a GA²M), so the model can capture, say, an age-by-income effect while still being plottable as a heatmap.
The maintainers state EBMs are as accurate as state-of-the-art techniques like random forests and gradient boosted trees — a claim from the project itself, so benchmark on your own data before taking it as given.
A Working Example
Install with pip install interpret. This example uses scikit-learn's bundled breast cancer dataset:
import numpy as np
from interpret.glassbox import ExplainableBoostingClassifier
from interpret import show
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, random_state=0, stratify=y
)
ebm = ExplainableBoostingClassifier(interactions=5, random_state=0)
ebm.fit(X_train, y_train)
print("AUROC:", roc_auc_score(y_test, ebm.predict_proba(X_test)[:, 1]))
show(ebm.explain_global()) # whole model
show(ebm.explain_local(X_test[:5], y_test[:5])) # individual predictions
The API follows scikit-learn conventions, EBMs support pandas DataFrames and NumPy arrays, and they handle string data natively, so there's little preprocessing. show() opens an interactive dashboard in a notebook.
Reading an EBM
- Global importance: a bar chart ranking terms by their average absolute contribution, covering both single features and interaction pairs.
- Shape functions: click any feature to see its curve. The x-axis is the feature value, the y-axis is the contribution to the score (log-odds for classification), and the shaded band shows uncertainty from bagging. Flat regions mean the feature doesn't matter there, steps show thresholds the model found, and wide bands warn you to trust that region less.
- Interaction heatmaps: for pairs, a color grid showing the extra effect beyond the two main effects.
- Local explanations: for one prediction, a bar for each term's contribution, plus the intercept.
Here's the property that sets EBMs apart from post-hoc tools: the explanation is not an approximation. The prediction literally equals the intercept plus the sum of those contributions, so you can verify it:
contribs = ebm.eval_terms(X_test) # one column per term
logit = contribs.sum(axis=1) + ebm.intercept_
prob = 1 / (1 + np.exp(-logit)) # matches predict_proba
With LIME or SHAP you ask how faithful the explanation is to the model. With an EBM, that question doesn't arise, because the explanation is the model — the distinction the SHAP walkthrough and LIME tutorial in this series spend whole posts on simply disappears.
Why That Matters in High-Stakes Settings
A well-known healthcare case study illustrates the value. A model trained to predict pneumonia mortality learned that patients with asthma had lower risk, an artifact of the fact that such patients received aggressive care and therefore did better. A black box would have shipped that pattern silently. A glass-box model makes it visible in a shape plot, where a clinician can spot it, question it, and correct it. The same logic applies to credit scoring, hiring tools, and any setting where someone will ask "why did the model do that?" or where a regulator expects you to document the reasoning.
Key Parameters
The defaults are sensible, and InterpretML's documentation shows values like 1024 maximum bins, 64 interaction bins, 14 outer bags, and a learning rate of 0.04 in its examples. The settings you're most likely to touch:
interactions: an integer count of pairwise terms to add, or a fraction. More interactions can improve accuracy but make the model harder to read. Setting 0 gives a pure GAM. EBMs include pairwise interactions by default, and higher-order terms require custom specification.outer_bags: more bags give smoother shapes and better uncertainty estimates at the cost of training time.max_bins: how finely continuous features are discretized.monotone_constraints: force a feature's effect to move in one direction, useful when domain rules say, for example, that risk shouldn't decrease as debt rises.feature_typesandfeature_names: override automatic detection when needed.random_state: fix it for reproducible shapes.
Monotonic Constraints, Handled Carefully
Constraints are valuable for trust, but they come with a caveat the library maintainers flag themselves. Since version 0.6.0, EBMs support monotone constraints during fitting, although post-processed monotonization is still suggested and preferred. The R wrapper's documentation explains why: during fitting, the boosting algorithm may compensate for a monotone constraint on one feature by using another correlated feature, potentially obscuring monotonic violations. In plain terms, you can enforce the rule on one curve while the model quietly routes the forbidden behavior through a correlated feature. After applying constraints, inspect the related features' shapes too.
Differentially Private EBMs
If your data is sensitive, InterpretML ships DPExplainableBoostingClassifier and DPExplainableBoostingRegressor in interpret.privacy, with the same explanation calls as standard EBMs. That gives you a glass-box model with a formal differential privacy guarantee, pairing the interpretability tools covered earlier in this series with privacy concepts. The usual cautions apply: privacy costs accuracy, the ε you report depends on your accounting, and tuning on private data consumes budget.
When EBMs Shine
EBMs are a strong fit when:
- Your data is tabular with a moderate number of features.
- You need explanations you can defend, in credit, insurance, healthcare, hiring, or public-sector settings.
- You want to debug data and model behavior by looking at shape functions, which routinely expose leakage, odd thresholds, and data artifacts.
- You need auditable, stable explanations that don't change from run to run the way sampling-based post-hoc methods can.
- You want a baseline that tells you how much accuracy a black box actually adds on your problem.
On that last point, a good habit is to train an EBM first. If a gradient-boosted model beats it by a trivial margin, the interpretable model wins on every other dimension.
When They Fall Short
- High-order interactions. EBMs capture main effects and pairwise interactions by default. If your problem depends on three-way or deeper interactions, a deep ensemble or neural net may beat it, though custom higher-order terms are possible.
- Unstructured data. Images, audio, and raw text aren't what EBMs are for. They work on engineered tabular features.
- Speed. Training and inference are generally slower than highly optimized boosted-tree libraries, though the project reports fitting datasets with 100 million samples in several hours, so scale isn't a hard barrier.
- Many features. Hundreds of terms mean hundreds of plots. The ranking view helps, but readability degrades as complexity grows.
- Correlated features. Additive models split credit among correlated features in ways that can look arbitrary, so don't over-read a single curve when features overlap heavily.
- Sparse regions. Shapes in thinly populated ranges can look jagged. The uncertainty bands warn you, and more bagging or smoothing helps.
- "Interpretable" isn't "causal." A shape function describes what the model learned from the data, which may reflect confounding, not cause and effect — the same caution the counterfactual guide repeats for recourse advice.
A Practical Workflow
- Start with an EBM as your baseline and compare it against your best black-box model on the metric that matters.
- Inspect the global importance chart, then walk through the shape functions of the top terms with a domain expert, noting anything implausible.
- Review interaction heatmaps for the pairs the model chose.
- Apply monotone constraints only where domain rules justify them, then recheck correlated features.
- Check local explanations on sampled and borderline cases, including the surprising ones.
- Save the model, its parameters, and exported explanations with the version for audit — the documentation discipline the model cards guide describes.
Common Pitfalls
- Assuming interpretable means correct, and skipping the review of shape functions that could reveal data leakage or spurious effects.
- Adding many interactions until the model is as opaque as the black box it replaced.
- Relying on monotone constraints without checking whether correlated features compensate.
- Comparing against a poorly tuned baseline, then drawing conclusions about EBM accuracy either way.
- Reading one correlated feature's curve in isolation.
- Treating shape functions as causal effects.
Recommended Books
| Cover | Book | Description | Get it |
|---|---|---|---|
![]() |
Interpretable Machine Learning | the GAM chapter this tutorial builds on. | View on Amazon |
![]() |
An Introduction to Statistical Learning | boosting and additive models from the ground up. | View on Amazon |
![]() |
Designing Machine Learning Systems | where a glass-box baseline fits in the production loop. | View on Amazon |
Unlock AI That Actually Works
Get lifetime access to GPT-6 Astra, Claude Fable 5.1, Gemini 3.5, Grok 4.5, and more — all in one platform. Build websites, apps, videos, content, and digital products from a single command. No monthly fees. No tool-hopping.
Click here to get GPTAstra Max now — one-time payment, lifetime access.
Frequently Asked Questions
What is an Explainable Boosting Machine?
An EBM is a generalized additive model (GAM) trained with modern machine learning techniques: it predicts as a sum of one-variable shape functions, g(prediction) = intercept + f1(x1) + ... + fn(xn), where each shape function shows exactly how one feature moves the prediction. Instead of splines, EBMs fit those shapes with cyclic gradient boosting (one feature per round with very small learning steps), bagging for smoothing and uncertainty bands, and automatic pairwise interaction detection (a GA2M), all behind a scikit-learn-style API in the InterpretML library.
Is an EBM's explanation faithful to the model?
Yes — that is the point of the architecture. The explanation is not an approximation: a prediction literally equals the intercept plus the sum of the per-term contributions, which you can verify with eval_terms, the intercept, and a sigmoid to match predict_proba exactly. With LIME or SHAP you ask how faithful the explanation is to the model; with an EBM that question doesn't arise, because the explanation is the model. Local explanations also stay stable run to run, unlike sampling-based post-hoc methods.
When should you use an EBM instead of gradient boosting?
When the data is tabular with a moderate number of features and explanations must be defended — credit, insurance, healthcare, hiring, or public-sector settings — or when you want to debug data behavior by reading shape functions, which routinely expose leakage, odd thresholds, and artifacts. A good habit: train an EBM first as your baseline, and if a gradient-boosted model beats it by a trivial margin, take the interpretable model. Skip EBMs for images, audio, or raw text, and for problems that hinge on three-way or deeper interactions.
What is the caveat with EBM monotone constraints?
You can enforce the rule on one curve while the model quietly routes forbidden behavior through a correlated feature: during fitting, the boosting algorithm may compensate for a monotone constraint on one feature by using another correlated feature, potentially obscuring monotonic violations. InterpretML has supported monotone constraints during fitting since 0.6.0, but post-processed monotonization is still suggested and preferred, so after applying constraints, inspect the related features' shapes too.
Wrapping This Up
InterpretML's Explainable Boosting Machine gives you an additive model trained with boosting, bagging, and automatic pairwise interactions, so every prediction decomposes into plottable, verifiable contributions. You get explanations that are the model itself, uncertainty bands, optional monotone constraints, and differentially private variants, all behind a scikit-learn-style API.
Does it beat gradient boosting on every dataset? No, and anyone claiming that should be tested on your data. But on tabular problems where explanations matter, it often gets close enough that giving up transparency for the last sliver of accuracy is hard to justify. Fit one as your baseline, plot a few shape functions, and see what your data has been trying to tell you.


