We initiate a novel approach to explain the out of sample performance of random forest (RF) models by exploiting the fact that any RF can be formulated as an adaptive weighted K nearest-neighbors model. Specifically, we use the proximity between points in the feature space learned by the RF to re-write random forest predictions exactly as a weighted average of the target labels of training data points. This linearity facilitates a local notion of explainability of RF predictions that generates attributions for any model prediction across observations in the training set, and thereby complements established methods like SHAP, which instead generates attributions for a model prediction across dimensions of the feature space. We demonstrate this approach in the context of a bond pricing model trained on US corporate bond trades, and compare our approach to various existing approaches to model explainability.
翻译:我们提出了一种新颖的方法来解释随机森林(RF)模型的样本外性能,其核心在于利用任意随机森林均可表示为自适应加权K近邻模型的特性。具体而言,我们通过随机森林在特征空间中学习的样本间邻近性,将随机森林预测精确重写为训练数据点目标标签的加权平均值。这种线性化处理使得我们能够对RF预测进行局部可解释性分析,为训练集中任意观测值对模型预测的贡献生成归因,从而与SHAP等现有方法形成互补(后者侧重于特征空间各维度对模型预测的归因)。我们以基于美国公司债券交易训练得到的债券定价模型为案例进行方法验证,并将所提方法与多种现有模型可解释性方法进行了对比分析。