[论文解读] Shapley Decomposition of R-Squared in Machine Learning Models
本文提出了一种模型无关的、基于Shapley值的R²分解方法,能够公平地将机器学习模型中解释的方差分配给各个特征,确保特征层面的贡献总和等于整体R²。该方法利用预先计算的Shapley值,避免了迭代的模型重新训练,从而在梯度提升树和神经网络中实现计算效率高、开销小的计算。
In this paper we introduce a metric aimed at helping machine learning practitioners quickly summarize and communicate the overall importance of each feature in any black-box machine learning prediction model. Our proposed metric, based on a Shapley-value variance decomposition of the familiar $R^2$ from classical statistics, is a model-agnostic approach for assessing feature importance that fairly allocates the proportion of model-explained variability in the data to each model feature. This metric has several desirable properties including boundedness at 0 and 1 and a feature-level variance decomposition summing to the overall model $R^2$. In contrast to related methods for computing feature-level $R^2$ variance decompositions with linear models, our method makes use of pre-computed Shapley values which effectively shifts the computational burden from iteratively fitting many models to the Shapley values themselves. And with recent advancements in Shapley value calculations for gradient boosted decision trees and neural networks, computing our proposed metric after model training can come with minimal computational overhead. Our implementation is available in the R package shapFlex.
研究动机与目标
- 开发一种模型无关的全局特征重要性度量,公平分配机器学习模型中解释的方差。
- 通过使用Shapley值在不重新拟合模型的情况下分解方差,解决传统R²在非线性模型中的局限性。
- 提供一种稳定、有界(0到1)的度量,其总和等于整体模型R²,从而增强模型行为的可解释性和可沟通性。
- 通过将迭代模型拟合转变为预计算的Shapley值,降低计算负担,尤其在使用现代Tree SHAP和神经网络近似方法时具有可行性。
- 弥合经典统计R²与现代机器学习可解释性之间的差距,支持实际的模型分析与沟通。
提出的方法
- 该方法采用基于Shapley值的方差分解,将模型的总R²归因于每个独立特征。
- 通过合作博弈论,计算每个特征独有的、可归因于其自身的模型解释方差比例,作为特征层面的R²。
- 该方法依赖于预计算的Shapley值,避免了在特征子集上重新训练模型的需求。
- 该分解确保了各特征R²贡献的总和等于整体模型R²,保持了方差的可加性。
- 该方法在R包shapFlex中实现,使用r2()函数对训练好的模型实现高效计算。
- 该方法兼容线性与非线性模型,包括梯度提升树和神经网络,尤其在使用Tree SHAP实现精确Shapley值计算时表现更优。
实验结果
研究问题
- RQ1基于Shapley值的R²分解能否在非线性机器学习模型中公平且高效地将解释方差分配给特征?
- RQ2在不同模型过拟合程度和超参数调优水平下,特征层面的R²分解稳定性如何?
- RQ3在复杂非线性模型中,该度量是否保持有界性(0到1)和总和等于R²的性质?
- RQ4特征相关性在多大程度上影响基于Shapley值的R²分解的有效性与稳定性?
- RQ5该度量能否有效应用于训练数据和测试数据?在分层或时间结构化数据中表现如何?
主要发现
- 在葡萄酒质量数据集中,随着R²从0.05增加到0.50,特征唯一方差贡献(σ_unique)从约0.88稳定下降至约0.68,表明该度量在模型复杂度变化下具有稳定性。
- 在野火数据集中,σ_unique在相同R²范围内从约0.86下降至约0.67,表明在特征相关性相似(均值约0.17)的数据集中行为一致。
- σ_unique趋势在不同数据集间的相似性提示了特征相关性与基于Shapley值的方差分解稳定性之间可能存在关联。
- 该度量保持了有界性(0到1)和总和等于R²的性质,证实了其理论合理性与可解释性。
- 通过预计算的Shapley值实现计算效率,尤其在使用Tree SHAP时,可在模型训练后实现近乎瞬时的R²分解。
- 该方法在模型解释中具有实际应用潜力,尤其适用于向非技术利益相关者传达特征重要性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。