Counterfactual examples (CFs) are one of the most popular methods for attaching post-hoc explanations to machine learning (ML) models. However, existing CF generation methods either exploit the internals of specific models or depend on each sample's neighborhood, thus they are hard to generalize for complex models and inefficient for large datasets. This work aims to overcome these limitations and introduces ReLAX, a model-agnostic algorithm to generate optimal counterfactual explanations. Specifically, we formulate the problem of crafting CFs as a sequential decision-making task and then find the optimal CFs via deep reinforcement learning (DRL) with discrete-continuous hybrid action space. Extensive experiments conducted on several tabular datasets have shown that ReLAX outperforms existing CF generation baselines, as it produces sparser counterfactuals, is more scalable to complex target models to explain, and generalizes to both classification and regression tasks. Finally, to demonstrate the usefulness of our method in a real-world use case, we leverage CFs generated by ReLAX to suggest actions that a country should take to reduce the risk of mortality due to COVID-19. Interestingly enough, the actions recommended by our method correspond to the strategies that many countries have actually implemented to counter the COVID-19 pandemic.
翻译:反事实实例(CFS)是将后热解解析作为机器学习(ML)模型的最流行方法之一,然而,现有的CF生成方法要么利用具体模型的内部,要么取决于每个样本的周围环境,因此很难对复杂的模型加以概括,对大型数据集来说效率低下。这项工作旨在克服这些限制并引入ReLAX,这是一个模型-不可知的算法,以产生最佳反事实解释。具体地说,我们将CF的编译问题作为一种顺序决策任务,然后通过深度强化学习(DRL)找到最佳的CF(DRL)和不连续的混合行动空间。在几个表格数据集上进行的广泛实验表明,RELAX超越了现有的CF生成基准,因为它产生较稀薄的反事实,因此对于复杂的目标模型来说,解释、概括和概括既能产生最佳反事实解释,又能产生最佳反事实解释。最后,为了证明我们的方法在现实使用的情况下有用,我们利用ReLAX产生的CFS(D)来找到最佳的FCFCFS,以便建议一个国家能够真正降低CVI风险的行动。