Explainable AI (XAI) Beginner 13 minutes

Inherently Interpretable Models

When a transparent model is enough, and why Cynthia Rudin calls for preferring it in high-stakes decisions.

Your progress in the track0%

Common transparent models

ModelHow we read itWarnings
Linear and logisticThe coefficients and their signsScales must be standardized, and beware of correlation between features
A small decision treeThe path of rulesA deep tree loses transparency and is unstable
Rule listsIf… then…May lose some accuracy
GAM / EBMA curve for each featureInteractions are limited or explicit

Logistic Regression

$$\log\frac{p}{1-p} = \beta_0 + \sum_j \beta_j x_j$$

\(e^{\beta_j}\) is the odds ratio for a one-unit increase in \(x_j\).

Additive models

$$g(\mathbb{E}[y]) = \beta_0 + f_1(x_1) + f_2(x_2) + \dots$$

# pip install interpret
from interpret.glassbox import ExplainableBoostingClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
X_tr, X_te, y_tr, y_te = train_test_split(X, y, stratify=y, random_state=0)
ebm = ExplainableBoostingClassifier(random_state=0).fit(X_tr, y_tr)
print(ebm.score(X_te, y_te))
# ebm.explain_global() shows the effect curve of each feature

Rudin's argument

  • A post-hoc explanation is an approximation; if it were completely accurate, why not use it as the model?
  • In many tabular-data problems the difference in performance is small.
  • A transparent model makes errors easier to detect and audit.

This does not apply as easily to raw images and texts, where deep networks clearly outperform; that is why we need the rest of the tools in this track.

Lesson terms

Generalized additive model
A model that writes the prediction as a sum of separate functions for each feature, so the effect of each feature can be plotted.
Odds ratio
The factor by which the odds of the outcome are multiplied when the feature increases by one unit in logistic regression.

Abstract

Some models are transparent by nature: linear and logistic regression (readable coefficients), small trees and rule lists, and generalized additive models (GAM), which add up simple functions for each feature. On a lot of tabular data their performance comes close to complex models. Rudin called for using transparent models instead of explaining black boxes in high-stakes decisions, because a post-hoc explanation is an approximation that may not be faithful.

Review questions

  1. How do we interpret a coefficient of 0.7 for a feature in a logistic regression?

    A one-unit increase in the feature multiplies the odds by e^0.7 ≈ 2, holding the other features fixed.

  2. What is Rudin's main argument?

    In high-stakes decisions we prefer a transparent model with similar performance over an approximate explanation of a black box.

Sources and references

  1. Rudin (2019) — Stop explaining black box machine learning models for high stakes decisions
  2. InterpretML (Explainable Boosting Machine)
  3. Molnar — Interpretable Machine Learning: Interpretable Models

Complete the lesson