Despite the success of complex machine learning algorithms, mostly justified by an outstanding performance in prediction tasks, their inherent opaque nature still represents a challenge to their responsible application. Counterfactual explanations surged as one potential solution to explain individual decision results. However, two major drawbacks directly impact their usability: (1) the isonomic view of feature changes, in which it is not possible to observe \textit{how much} each modified feature influences the prediction, and (2) the lack of graphical resources to visualize the counterfactual explanation. We introduce Counterfactual Feature (change) Importance (CFI) values as a solution: a way of assigning an importance value to each feature change in a given counterfactual explanation. To calculate these values, we propose two potential CFI methods. One is simple, fast, and has a greedy nature. The other, coined CounterShapley, provides a way to calculate Shapley values between the factual-counterfactual pair. Using these importance values, we additionally introduce three chart types to visualize the counterfactual explanations: (a) the Greedy chart, which shows a greedy sequential path for prediction score increase up to predicted class change, (b) the CounterShapley chart, depicting its respective score in a simple and one-dimensional chart, and finally (c) the Constellation chart, which shows all possible combinations of feature changes, and their impact on the model's prediction score. For each of our proposed CFI methods and visualization schemes, we show how they can provide more information on counterfactual explanations. Finally, an open-source implementation is offered, compatible with any counterfactual explanation generator algorithm. Code repository at: https://github.com/ADMAntwerp/CounterPlots
翻译:尽管复杂机器学习算法取得了成功(主要归因于其在预测任务中的出色性能),但其固有的不透明性仍对其负责任应用构成挑战。反事实解释作为解释个体决策结果的一种潜在解决方案应运而生。然而,两个主要缺陷直接影响其可用性:(1) 特征变化的等位性视角,即无法观测每个被修改特征对预测结果的影响程度;(2) 缺乏用于可视化反事实解释的图形化工具。我们提出反事实特征(变化)重要性(CFI)值作为解决方案:一种为给定反事实解释中每个特征变化分配重要性值的方法。为计算这些值,我们提出两种潜在的CFI方法:一种简单、快速且具有贪婪特性;另一种称为CounterShapley,提供计算事实-反事实对之间的Shapley值的方法。利用这些重要性值,我们进一步引入三种图类型以可视化反事实解释:(a) 贪婪图(Greedy chart),展示预测分数递增至类别变化时的贪婪顺序路径;(b) CounterShapley图,以简单一维图形式呈现其相应分数;(c) 星座图(Constellation chart),展示所有可能的特征变化组合及其对模型预测分数的影响。针对我们提出的每种CFI方法和可视化方案,我们展示了其如何为反事实解释提供更多信息。最后,我们提供与任何反事实解释生成算法兼容的开源实现。代码仓库地址:https://github.com/ADMAntwerp/CounterPlots