Tree Ensemble Explainability through the Hoeffding Functional Decomposition and TreeHFD Algorithm

Clement Benard

Tree ensembles, such as Random Forests and XGBoost, are the undisputed leaders for predictive modeling on tabular data. However, their complexity—often involving thousands of decision paths—makes them notoriously difficult to interpret. This paper introduces TreeHFD, a novel algorithm designed to transform these "black box" models into transparent, additive components using the Hoeffding (or ANOVA) functional decomposition.

The Challenge of Interpretability

To explain a complex model $f(x)$, researchers often use functional decomposition to split it into a sum of simpler parts: $f(x) = f_0 + \sum f_i(x_i) + \sum f_{i,j}(x_i, x_j) + \dots$. This allows users to see exactly how much each variable contributes individually (main effects) and how much they contribute through combinations (interactions).

The Hoeffding decomposition is considered the gold standard for this approach because it ensures that interactions are "pure" and do not contain hidden main effects. However, estimating this decomposition is mathematically difficult when input variables are dependent or when the underlying data distribution is unknown—a common scenario in real-world machine learning.

The TreeHFD Approach

TreeHFD (Tree Hoeffding Functional Decomposition) is the first algorithm to accurately estimate this decomposition directly from a data sample by exploiting the specific rectangular structure of decision trees. The method relies on two core technical innovations:

  1. Cartesian Tree Partitioning: While individual trees divide space into irregular rectangular cells, TreeHFD creates a "Cartesian" version of this partition. It collects every split point for every variable across the entire ensemble to create a fine-grained, global grid.
Comparison between a standard tree partition (left) and the Cartesian partition used by TreeHFD (right).
  1. Least Squares Optimization: The algorithm frames the decomposition as a constrained least-squares problem. It seeks the unique set of piecewise constant functions that satisfy "hierarchical orthogonality." This ensures that if a variable has no actual effect on the model, its corresponding component is zero—a property known as the "reluctance principle."

Experimental Validation and Key Insights

The authors evaluated TreeHFD using both synthetic analytical cases and nine real-world benchmarks (e.g., California Housing, Bike Sharing).

In synthetic tests, the algorithm demonstrated strong convergence, accurately recovering complex underlying patterns like sinusoidal and quadratic functions from noisy data samples.

Estimated Hoeffding components for two features, recovering sinusoidal and quadratic trends from noisy data.

Stability vs. SHAP

One of the paper's most significant findings is the comparison between TreeHFD and TreeSHAP. While SHAP is a popular local explanation tool, it can be unstable; two similar data points may receive wildly different explanations. TreeHFD’s components vary much more smoothly, providing "locally stable" explanations that are more reliable for end-users. Furthermore, the authors prove that TreeHFD achieves the same "causal variable selection" as interventional SHAP, correctly identifying the true drivers of the model's logic.

Conclusion

TreeHFD bridges the gap between high-performance tree ensembles and human-readable explanations. By providing a stable, mathematically grounded decomposition with a residual error of typically only ~1%, it offers a robust alternative to noisy local explanation methods. While the computational cost can grow with tree depth, the authors provide pruning heuristics to keep the algorithm efficient for practical use.

The implementation is available as an open-source Python package at github.com/ThalesGroup/treehfd.

Summary updated

BibTeX
@inproceedings{benard2025tree,
  author = {Clement Benard},
  title = {{Tree Ensemble Explainability through the Hoeffding Functional Decomposition and TreeHFD Algorithm}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=dRLWcpBQxS},
}
Figure