Due to their power and ease of use, tree-based machine learning models, such as random forests and gradient-boosted tree ensembles, have become very popular. To interpret them, local feature attributions based on marginal expectations, e.g. marginal (interventional) Shapley, Owen or Banzhaf values, may be employed. Such methods are true to the model and implementation invariant, i.e. dependent only on the input-output function of the model. We contrast this with the popular TreeSHAP algorithm by presenting two (statistically similar) decision trees that compute the exact same function for which the "path-dependent" TreeSHAP yields different rankings of features, whereas the marginal Shapley values coincide. Furthermore, we discuss how the internal structure of tree-based models may be leveraged to help with computing their marginal feature attributions according to a linear game value. One important observation is that these are simple (piecewise-constant) functions with respect to a certain grid partition of the input space determined by the trained model. Another crucial observation, showcased by experiments with XGBoost, LightGBM and CatBoost libraries, is that only a portion of all features appears in a tree from the ensemble. Thus, the complexity of computing marginal Shapley (or Owen or Banzhaf) feature attributions may be reduced. This remains valid for a broader class of game values which we shall axiomatically characterize. A prime example is the case of CatBoost models where the trees are oblivious (symmetric) and the number of features in each of them is no larger than the depth. We exploit the symmetry to derive an explicit formula, with improved complexity and only in terms of the internal model parameters, for marginal Shapley (and Banzhaf and Owen) values of CatBoost models. This results in a fast, accurate algorithm for estimating these feature attributions.
翻译:由于其强大性和易用性,基于树的机器学习模型,如随机森林和梯度提升树集成,已变得非常流行。为了解释这些模型,可基于边际期望(例如边际(干预)Shapley、Owen或Banzhaf值)进行局部特征归因。这类方法忠实于模型且具有实现不变性,即仅依赖于模型的输入-输出函数。我们将此与流行的TreeSHAP算法进行对比,通过呈现两个(统计相似的)决策树(它们计算完全相同的函数)说明:对于该函数,“路径依赖型”TreeSHAP会产生不同的特征排序,而边际Shapley值保持一致。此外,我们探讨了如何利用树模型的内部结构,根据线性博弈值计算其边际特征归因。一个重要观察是,这些函数相对于由训练模型确定的输入空间网格划分是简单的(分段常数)。另一个关键观察(通过XGBoost、LightGBM和CatBoost库的实验展示)是,集成树中仅包含部分特征。因此,计算边际Shapley(或Owen或Banzhaf)特征归因的复杂度得以降低。这一结论对更广泛的博弈值类(我们将其进行公理化刻画)同样成立。一个典型例子是CatBoost模型,其树结构为无感知树(对称),且每棵树中的特征数不超过深度。我们利用该对称性推导出了CatBoost模型边际Shapley(以及Banzhaf和Owen)值的显式公式,该公式仅依赖内部模型参数且具有更优的复杂度。由此产生了快速、精确的算法用于估计这些特征归因。