Exact Functional ANOVA Decomposition for Categorical Inputs Models

Baptiste Ferrere, Nicolas Bousquet, Fabrice Gamboa, Jean-Michel Loubes, Joseph Muré

Introduction: The Independence Barrier in Interpretability

In the quest to understand "black-box" machine learning models, Functional ANOVA (fANOVA) serves as a gold standard. It provides a principled framework for interpretability by decomposing a model’s prediction into a sum of individual feature effects (main effects) and their higher-order interactions.

However, fANOVA has traditionally suffered from a major limitation: it requires input features to be strictly independent. In real-world datasets, features are almost always correlated. When this independence assumption is violated, the underlying mathematics break down. Historically, practitioners have been forced to rely on sampling-based approximations, which are computationally expensive, noisy, and often fail to satisfy the strict mathematical requirements of a true ANOVA decomposition. This paper completely resolves this limitation for categorical inputs, offering a closed-form, exact method for fANOVA decomposition even when features are highly dependent.

Methodology: Bridging Functional and Fourier Analysis

To overcome the independence barrier, the authors bridge functional analysis with an extension of discrete Fourier theory. Their framework is built on three core pillars:

  1. The Inverse Likelihood Mechanism: The researchers define a new family of basis functions that generalize the Walsh-Hadamard basis (commonly used in binary logic) to arbitrary categorical settings. These functions are designed to incorporate the "likelihood" of feature combinations, allowing the mathematics to hold even when certain combinations of categories never appear in the training data.
  2. Closed-Form Decomposition: Unlike previous methods that rely on iterative optimization or heavy sampling, this approach derives an explicit linear system to find the ANOVA coefficients. This guarantees "hierarchical orthogonality," ensuring that the information captured in a pairwise interaction is strictly new and does not overlap with the main effects.
  3. A Greedy Rank-Based Algorithm: Categorical datasets often suffer from the curse of dimensionality, where the total number of possible category combinations is astronomical. To address this, the authors introduce a greedy algorithm that identifies a subset of basis vectors spanning the actual observed data support. It prioritizes low-order interactions (main effects and pairs), which typically drive the majority of a model's predictive behavior.

Key Insights and Practical Applications

The theoretical breakthroughs in this paper translate into several powerful practical insights for model interpretability:

  • Exploiting Sparsity: In high-dimensional categorical spaces, the "hypergrid" of possible combinations is mostly empty. The authors demonstrate that the "effective dimension" of the problem is much lower than the theoretical maximum, a property they exploit to make exact computation tractable.
  • Unifying SHAP and ANOVA: A standout contribution of this framework is its natural generalization of SHAP values. In scenarios with independent features, the ANOVA-based Shapley values perfectly match standard SHAP. Crucially, their method remains theoretically grounded and accurate even when features exhibit complex dependencies.
  • Correcting Interpretability Misconceptions: The framework's precision was highlighted on the Poker Hand dataset. While common interpretability methods like "Attention Rollout" mistakenly attributed high importance to card suits, the exact fANOVA method correctly identified that card ranks are the primary drivers of the model's logic—perfectly aligning with the actual rules of poker.

Empirical Results

The framework was rigorously validated across synthetic data, standard tabular benchmarks (e.g., Car Evaluation, Nursery, Mushrooms), high-dimensional sparse datasets (Connect-4, Dota2), and even binarized MNIST images.

  • Remarkable Efficiency: The method computed the full decomposition for the Car Evaluation dataset in just 0.5 seconds and the Nursery dataset in 54 seconds.
  • High Accuracy: On the Mushrooms dataset, the main effects alone reconstructed the model's signal with an $R^2 \approx 1$, achieving a negligible error of $10^{-15}$ in only 0.3 seconds.
  • Robustness to Dependency: When tested with perfectly correlated variables, the method successfully isolated the true underlying functional space, vastly outperforming previous state-of-the-art methods like TreeHFD, which exhibited significant errors in orthogonality.

Limitations and Future Directions

While this paper marks a significant leap forward, the authors note a few remaining challenges. First, the greedy algorithm can become a computational bottleneck when searching for higher-order interactions in datasets with hundreds of features. Second, in extremely sparse regimes or with perfectly correlated features, there is an "identifiability issue" where multiple valid decompositions exist—a geometric property of the data rather than a flaw in the algorithm. Finally, the current exact closed-form solution is limited to categorical data; extending this rigorous framework to continuous domains remains an exciting frontier for future research.

Summary updated

BibTeX
@inproceedings{ferrere2026exact,
  author = {Baptiste Ferrere and Nicolas Bousquet and Fabrice Gamboa and Jean-Michel Loubes and Joseph Muré},
  title = {{Exact Functional ANOVA Decomposition for Categorical Inputs Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=qC9FEfYjai},
}
Figure