InterpretML

On this page 7

InterpretML is an open-source Python toolkit for training interpretable machine learning models and explaining opaque ones through a single, unified API. In Explainable AI, it is best known as the home of the Explainable Boosting Machine (EBM), a glassbox model that often matches the accuracy of gradient-boosted trees while remaining fully readable.

Released by Microsoft Research in 2019 under the MIT license, InterpretML separates two strategies: glassbox models that are interpretable by design, and blackbox explainers that approximate the reasoning of models already trained elsewhere. Both produce explanation objects that render in the same interactive visualization dashboard.

How InterpretML structures explanations

Every InterpretML component follows a scikit-learn style interface. Glassbox models expose fit and predict, and every model or explainer offers explain_global() for overall behavior and explain_local() for individual predictions. The resulting objects are passed to show(), which opens an interactive view in a notebook or browser.

This consistent design lets practitioners compare explanation methods side by side on the same data. The table below lists the main components shipped with the package.

ComponentCategoryExplanation scope
Explainable Boosting MachineGlassbox modelGlobal and local, exact
Linear and logistic regressionGlassbox modelGlobal and local, exact
Classification and regression treesGlassbox modelGlobal and local, exact
Decision list classifierGlassbox modelRule-based, exact
SHAP kernel explainerBlackbox explainerLocal attributions
LIME tabular explainerBlackbox explainerLocal surrogate
Partial dependenceBlackbox explainerGlobal feature effect
Morris sensitivity analysisBlackbox explainerGlobal feature ranking
Main InterpretML components

Global explanations show term importances and the full shape curve for each feature, while local explanations break one prediction into additive contributions that sum to the model output. The dashboard can also place several explanations together, which helps reviewers see whether a glassbox model and a blackbox explainer agree on the most influential features.

How the Explainable Boosting Machine works

The EBM is a generalized additive model with interactions (GA2M). Its prediction is a sum of one learned shape function per feature plus a small number of pairwise interaction terms, passed through a link function such as the logit for classification.

Training uses cyclic gradient boosting: the algorithm fits very shallow trees on one feature at a time, cycles through all features in round-robin order and uses a very low learning rate over thousands of rounds. This makes feature order irrelevant and limits collinearity effects. Bagging over many outer rounds then smooths the curves and yields uncertainty bands. Candidate interactions are ranked with the FAST heuristic, and only the strongest pairs are added.

ParameterTypical settingEffect
learning_rateAbout 0.01 or lowerSmaller steps, smoother shape functions
max_roundsThousands of roundsUpper limit on boosting passes
interactions0 to about 10 pairs, or a fractionAccuracy versus readability
max_binsAround 256 to 1024Resolution of each shape function
outer_bagsAbout 8 to 14Stability and error bars
Key EBM parameters

Because each term is a lookup table, an EBM is exactly decomposable: the contribution of every feature to a single prediction is known without approximation. Prediction is also very fast, although training is slower than standard boosting libraries.

InterpretML differs from attribution libraries because it offers models that need no post hoc explanation. Libraries such as SHAP, Captum or AI Explainability 360 focus mainly on explaining existing models, so the choice depends on whether the model can still be replaced.

ToolMain focusTypical model type
InterpretMLGlassbox models plus blackbox explainersTabular data
SHAP libraryShapley value attributionsTabular, trees, deep networks
CaptumGradient-based attributionPyTorch neural networks
AI Explainability 360Broad collection of methodsTabular, text, images
What-If ToolInteractive what-if probingDeployed classifiers
InterpretML and neighboring tools

Post hoc methods such as SHAP or LIME produce approximations whose faithfulness can vary, while an EBM explanation is the model itself. The trade-off is scope: EBMs excel on tabular data and are not suited to images, audio or raw text.

When to use InterpretML

InterpretML is most valuable when accountability matters as much as accuracy, for example in credit scoring, insurance pricing, clinical risk models and public sector decisions. In these settings, reviewers and regulators often need to inspect and challenge each feature effect.

  • Start with an EBM as a baseline on tabular problems; if accuracy is close to a black-box model, the glassbox model is usually the safer choice.
  • Inspect shape functions for implausible patterns, such as risk dropping sharply at an arbitrary age, which may reveal data errors or leakage.
  • Edit or constrain terms when domain experts reject a learned effect, since each term can be modified directly.
  • Use differentially private EBMs when training data is sensitive and formal privacy guarantees are required.
  • Reserve blackbox explainers for models that cannot be retrained, and validate their output on known cases.

Limitations and common misreadings

An interpretable model is not automatically a causal model. A shape function shows how the model uses a feature, not what would happen if the feature changed in the real world. Correlated features can also share credit unpredictably, so one curve may look flat while a correlated partner absorbs the effect.

PitfallCauseRemedy
Jagged shape functionsToo few samples in some binsIncrease bagging or reduce bins
Unreadable modelToo many interaction termsLimit interactions to a few pairs
Causal claims from curvesConfusing association with effectUse causal analysis separately
Slow training on large dataMany rounds and outer bagsSample data or reduce bags
Common pitfalls and remedies

Blackbox explainers in the package inherit the known weaknesses of their methods. Kernel SHAP and LIME depend on sampling and background data, so repeated runs can give slightly different attributions, and perturbed samples may fall outside the realistic data distribution. Results should therefore be checked for stability across random seeds before they reach decision makers.

In plain words

Many AI models give answers without showing their reasoning. InterpretML helps open that box. It offers models that show their reasoning from the start. It also offers tools that estimate the reasoning of other models.

Its best-known model works like a score sheet. Each factor, such as age or income, adds or subtracts points. You can see every line on the sheet. Nothing important stays hidden, so people can check whether the logic makes sense.

A real-world example

A hospital analytics team builds a model to predict 30-day readmission risk for discharged patients. A gradient-boosted tree model reaches an AUC of about 0.78, but clinicians refuse to act on scores they cannot inspect.

The team trains an Explainable Boosting Machine with InterpretML on the same data and reaches an AUC within about one point of the black-box model. Reviewing the shape functions, clinicians notice that patients with a recorded asthma diagnosis appear to have lower predicted risk. Investigation shows these patients receive more intensive follow-up care, which distorts the pattern.

The team edits that term, documents the decision and deploys the EBM. Each risk score now arrives with a per-feature breakdown, and clinicians use it to plan follow-up calls, which builds trust in the model.