interpretml/interpret

Fit interpretable models. Explain blackbox machine learning.

InterpretML – Making Machine‑Learning Models Transparent

What it is

InterpretML is an open‑source Python library that bundles a collection of model‑interpretability tools. It lets you:

  • Train glass‑box models that are inherently understandable (e.g., Explainable Boosting Machines, decision trees, rule lists, linear models).
  • Explain black‑box models with post‑hoc methods such as SHAP, LIME, Morris sensitivity analysis and partial dependence.
  • Visualise global model behaviour, drill‑down to individual predictions, and compare multiple models in an interactive dashboard.

The library is built on top of familiar scientific‑Python stacks (scikit‑learn, pandas, NumPy) and uses Plotly/Dash for the UI.


Why it matters

Interpretability is crucial when models affect high‑stakes decisions (healthcare, finance, law, etc.). With InterpretML you can:

  • Debug why a model made a mistake.
  • Engineer features by spotting misleading or missing inputs.
  • Detect fairness issues and ensure regulatory compliance.
  • Collaborate with domain experts who can edit the model directly (e.g., adjusting an Explainable Boosting Machine).

Core features (as described in the README)

Feature What it does
Explainable Boosting Machine (EBM) A Generalized Additive Model with bagging, gradient boosting and automatic interaction detection. Provides exact, editable explanations and matches the accuracy of state‑of‑the‑art black‑box models.
Other glass‑box models APLR, Decision Tree, Decision Rule List, Linear/Logistic Regression – all expose native explain_global/explain_local APIs.
Black‑box explainers SHAP Kernel, LIME, Morris Sensitivity Analysis, Partial Dependence – wrap any scikit‑learn‑compatible estimator.
Interactive visualisations interpret.show() renders dashboards for global, local and comparative explanations (plots of feature contributions, interaction heat‑maps, etc.).
Differential privacy DP‑EBM variants (DPExplainableBoostingClassifier/Regressor) let you train with formal privacy guarantees (ε, δ parameters).
Scalability EBMs can handle 100 M+ rows on a single machine; larger workloads can be distributed via Azure SynapseML.
Installation pip install interpret or conda install -c conda-forge interpret. Works on Python 3.10+ across Linux, macOS, Windows.

Who uses it?

  • Data scientists needing quick, trustworthy explanations.
  • Regulated industries (healthcare, finance, security) where model auditability is mandatory.
  • Researchers building or benchmarking new interpretability methods.
  • Microsoft Azure customers leveraging the distributed EBMs integration.

Getting started (quick code snippet)

from interpret.glassbox import ExplainableBoostingClassifier
from interpret import show

# Train a glass‑box model
ebm = ExplainableBoostingClassifier()
ebm.fit(X_train, y_train)

# Global explanation (feature importance, shape functions)
global_exp = ebm.explain_global()
show(global_exp)

# Local explanation for a single instance
local_exp = ebm.explain_local(X_test[:5], y_test[:5])
show(local_exp)

The show calls open an interactive Plotly dashboard in a notebook or browser.


Documentation & community

  • Full docs: https://interpret.ml/docs
  • Example notebooks (Colab, Binder) for classification, regression, custom interactions, and DP‑EBM.
  • The project is actively maintained (CI badge, code‑coverage, open‑source contributions) and credits a long list of academic papers.

TL;DR

InterpretML is a real, production‑ready Python package that unifies a suite of interpretable models and post‑hoc explainers, letting you build, inspect, and audit machine‑learning systems with minimal friction.

Related

  • Project
  • Project
  • Project
  • Project
  • Project