Purifying Interaction Effects with the Functional ANOVA: An Efficient Algorithm for Recovering Identifiable Additive Models

Benjamin J. Lengerich, Sarah Tan, Chun-Hao Chang, Giles Hooker, Rich Caruana

Introduction: The Identifiability Crisis in Interpretable ML

In the quest for interpretable machine learning, researchers often turn to Generalized Additive Models (GAMs) with interaction terms. These models are typically represented as:

$Y \approx f_0 + f_1(X_1) + f_2(X_2) + f_3(X_1, X_2)$

While this structure appears straightforward, it suffers from a fundamental problem: identifiability. It is possible to shift "mass" between these functions—for example, adding a constant to $f_1$ and subtracting it from $f_0$—without changing the final prediction $Y$. More critically, complex patterns can "leak" from the main effects into the interaction term $f_3$, creating a representational degeneracy where two models produce identical predictions but offer completely different explanations.

Figure 1: Four different decompositions (a-d) of the same model. Each row represents a different way to assign values to the intercept ($f_0$), main effects ($f_1, f_2$), and interaction ($f_3$) while yielding identical total predictions. Row (d) represents the unique, purified canonical form.

As shown in Figure 1, the same underlying signal can be represented in multiple ways. For a scientist or policy-maker, this is a nightmare: how can one trust a model's "main effect" if it is merely an arbitrary byproduct of how the optimization algorithm was initialized?

The Purify Algorithm

To resolve this, the authors propose defining pure interaction effects as variance in the outcome that cannot be represented by any subset of features. This definition is mathematically equivalent to the Functional ANOVA (fANOVA) decomposition.

The paper introduces the Purify algorithm, designed specifically for piecewise-constant functions, which are the building blocks of decision trees and modern GAMs like XGBoost or GA2M. The algorithm employs a "mass-moving" approach: it iteratively calculates the weighted mean of "slices" in an interaction tensor. If a slice has a non-zero mean, that mass is subtracted from the interaction term and added back to the corresponding lower-order main effect or the global intercept. Unlike previous fANOVA implementations, this algorithm is exact, fast, and converges in $O(\log(1/\epsilon))$ iterations.

Key Insights and Results

Resolving Interpretational Contradictions

The authors evaluated their approach on several high-stakes datasets, including COMPAS (recidivism risk) and MIMIC-III (medical mortality). On the COMPAS dataset, unpurified XGBoost models often showed opposite signs for some main effects compared to other models. Once purified, the interpretations across different model classes (XGBoost, GA2M, etc.) became consistent, revealing the true underlying relationships.

Correcting Prior Research on Random Forests

A significant contribution of the paper is the re-examination of a 2016 study which concluded that Random Forests are poor at identifying interactions. The authors demonstrated that the study's "interaction-only" data generators actually contained strong main effects after purification. When these effects are properly accounted for, Random Forests appear much more capable than previously thought.

Spatial Interpretability in California Housing

In the California Housing dataset, purification removed spurious effects that suggested the most expensive real estate was in the middle of the Pacific Ocean. By "purifying" the interaction between latitude and longitude, the model correctly attributed high values to coastal metro areas like Los Angeles and San Francisco.

Conclusion

Purification ensures that interaction terms only contain signal that cannot be explained by simpler main effects. This creates a unique and interpretable canonical form for tree-based models, ensuring that the explanations provided to stakeholders are stable, consistent, and mathematically sound. While the choice of data distribution weighting remains a factor, the Purify algorithm provides a robust framework for making complex additive models truly identifiable.

Summary updated

BibTeX
@inproceedings{lengerich2020purifying,
  author = {Benjamin J. Lengerich and Sarah Tan and Chun-Hao Chang and Giles Hooker and Rich Caruana},
  title = {{Purifying Interaction Effects with the Functional ANOVA: An Efficient Algorithm for Recovering Identifiable Additive Models}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2020},
}
Figure