arXiv:2602.21845cs.LGcs.AI2026-02

让复杂解释更简洁:自动精简反事实说明。

xai-cola: A Python library for sparsifying counterfactual explanations

  • 通过可插拔策略自动减少反事实解释中的冗余特征变动。
  • 实验显示特征修改数量最多降低50%。
  • 适合需要清晰、简洁解释的机器学习应用者。

反事实解释(CE)是事后可解释性的重要领域,但大多数生成器产生的解释存在高度冗余。本文介绍开源 Python 库 xai-cola,提供端到端流程,对任意生成器输出的反事实解释进行稀疏化处理,在保持解释有效性的同时减少不必要的特征变化。该库支持输入原始表格数据(pandas DataFrame)、预处理对象(用于标准化和编码),以及训练好的 scikit-learn 或 PyTorch 模型。用户可使用内置或外部导入的 CE 生成器。库中实现多种稀疏化策略,并包含可视化工具以分析和比较稀疏化后的反事实结果。xai-cola 采用 MIT 许可证,可通过 PyPI 安装。实验证明,该工具在多个 CE 生成器上均能生成更稀疏的解释,本设置下特征修改数最多减少50%。源码位于 https://github.com/understanding-ml/COLA。

原文摘要 · Abstract (English)

Counterfactual explanation (CE) is an important domain within post-hoc explainability. However, the explanations generated by most CE generators are often highly redundant. This work introduces an open-source Python library xai-cola, which provides an end-to-end pipeline for sparsifying CEs produced by arbitrary generators, reducing superfluous feature changes while preserving their validity. It offers a documented API that takes as input raw tabular data in pandas DataFrame form, a preprocessing object (for standardization and encoding), and a trained scikit-learn or PyTorch model. On this basis, users can either employ the built-in or externally imported CE generators. The library also implements several sparsification policies and includes visualization routines for analysing and comparing sparsified counterfactuals. xai-cola is released under the MIT license and can be installed from PyPI. Empirical experiments indicate that xai-cola produces sparser counterfactuals across several CE generators, reducing the number of modified features by up to 50% in our setting. The source code is available at https://github.com/understanding-ml/COLA.

可解释性反事实代码库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。