Quick Reference · ML interpretability (Microsoft Research)

interpretml cheat sheet

InterpretML unifies two routes to understanding a model under one scikit-learn-style API. Glassbox: train an inherently interpretable model (the EBM) — its explanations are exact. Blackbox: wrap any fitted pipeline and probe it — explanations are approximate. Both speak the same two verbs — explain_global() and explain_local() — and both render through one show() dashboard. Learn the fork once and the classes stop being a list to memorise.

glassbox — exact blackbox — approximate explain verbs visualize data · perf · edit most common

Distilled & cross-checked across: interpret.ml/docs · github.com/interpretml/interpret · arxiv 1909.09223 · towardsdatascience.com · coderzcolumn.com · verified 2026-08-28 against interpret 0.7.8 (17 Mar 2026; Python 3.10–3.14) · EBM = Explainable Boosting Machine

Two paths, one API — glassbox vs blackbox
X_train, y no special prep GLASSBOX · train an interpretable model ExplainableBoosting… .fit(X, y) — sklearn API EBM · Linear · Tree · APLR BLACKBOX · wrap a fitted pipeline LimeTabular / ShapKernel wraps any predict fn RF · NN · XGB · pipelines explain_global() overall behaviour · importances explain_local(X) one prediction, decomposed → .data(i) exports the JSON exact ✓ approx ≈ show(…) interactive Plotly UI show([a,b]) → dashboard preserve() → save HTML before & after: interpret.data (ClassHistogram, Marginal) · interpret.perf (ROC, PR) — also render via show()
01Install & Importonce per env
02Glassbox Modelsinterpret.glassbox
03Fit & Explainthe core loop
04Visualizethe interactive UI
05Blackbox Explainersinterpret.blackbox
06Greyboxmodel-specific hooks
07Explore the Datainterpret.data
08Performanceinterpret.perf
09Edit a Fitted EBMglassbox superpowers
10Combine & ScaleEBMs compose
11Differential Privacyinterpret.privacy
12Render Setupwhere show() draws
Reading an EBM Graphwhat the axes mean

What the explanations look like

Every output is one explain_*() call rendered by show(). Sketches below show the shape of each — the real ones are interactive Plotly graphs with a feature dropdown.

explain_global() — summary

Overall term importances: mean absolute score per feature/interaction across the data. The dashboard's landing page.

MaritalStCapGain AgeEducAge×Hrs

explain_global() — a term

Drill into one feature: its learned shape function. This is the model — exact, editable, monotonizable.

feature value → score (logit) 0

explain_local(x) — one row

A single prediction decomposed: intercept + each term's ± score. Green pushes up, red pulls down — sums to the output.

0 (intercept) CapGain Age

show([a, b, c]) — dashboard

Pass a list and InterpretML builds a tabbed dashboard: compare data EDA, several models, and performance side by side.

tabs: Data · EBM · LIME · ROC

PartialDependence (blackbox)

Global average effect of a feature on any model's output — the blackbox counterpart to an EBM shape graph. Approximate.

feature value → avg output

perf.ROC — diagnostics

Wrap predict_proba and drop an interactive ROC (or PR / residual) panel into the same dashboard as your explanations.

false positive rate → true pos rate

Worth memorising

glassbox = exactEBM explanations perfectly describe the model — never approximate
blackbox = approximateLIME/SHAP perturb & guess — be cautious in high-stakes use
two verbsexplain_global (overall) · explain_local (one row)
show(x) vs show([x])single viz vs a full multi-panel dashboard
EBM y-axis = logitsfor classifiers, scores are log-odds, not probabilities
no preprocessingEBMs take raw pandas — categoricals handled natively
nothing renders?set_visualize_provider(InlineProvider())
glassbox > globaltrue global explanations need a glassbox — blackbox is mostly local