cfai

The package for counterfactual explanations on Pytorch platform


Keywords
counterfactual-explanations, explainable-ai, explainable-machine-learning, explainable-ml, interpretability, pytorch, recourse
License
MIT
Install
pip install cfai==0.1.0

Documentation

Maintenance versions

About CFAI(Counterfactual Explanation for AI on Pytorch)

Counterfactual explanations mainly target to find the mimimum perturbation which changes the original prediction(Ususlly from an undesirable prediction to ideal one). The perturbation itself is a valid instance following the real data distribution as the training samples. It has broad applications, E.g., finance, education, health care ect. Specifically, what should I do to get the credit card approved if I received the rejection.

This task is popular recently. However, I only find few released repositories on Pytorch platform. Hence, I create this project and plan to implement some famous algorithms continously. I appreciate it very much if anyone can contribute to this project together with me. For the implementation details, I am glad to discuss with all of you together.

A collection of methods on counterfactual explanation to add into this repository. Continously updating.

Installation

This is a half-year plan. The installation just serves as a placeholder.

Installation Requirements

  • Pytorch >= 1.0+
  • Python >= 3.6

CF only supports Python3+. If you want to install the latest version, run the command in the root folder

git clone https://github.com/wangyongjie-ntu/Counterfactual-Explanations-Pytorch

cd Counterfactual-Explanations-Pytorch

pip install -e .

For the stable version installation, you can directly install it from PyPI via

pip install cfai

Getting Start

To be done.

References

[1] Wachter, Sandra, Brent Mittelstadt, and Chris Russell. "Counterfactual explanations without opening the black box: Automated decisions and the GDPR." Harv. JL & Tech. 31 (2017): 841. https://arxiv.org/pdf/1711.00399.pdf

[2] Mothilal, Ramaravind K., Amit Sharma, and Chenhao Tan. "Explaining machine learning classifiers through diverse counterfactual explanations." Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency. 2020. https://arxiv.org/pdf/1905.07697.pdf

[3] Laugel, Thibault, et al. "Inverse classification for comparison-based interpretability in machine learning." arXiv preprint arXiv:1712.08443 (2017).https://arxiv.org/abs/1712.08443

[4] Joshi, Shalmali, et al. "Towards realistic individual recourse and actionable explanations in black-box decision making systems." arXiv preprint arXiv:1907.09615 (2019). https://arxiv.org/pdf/1907.09615.pdf

[5] Dhurandhar, Amit, et al. "Explanations based on the missing: Towards contrastive explanations with pertinent negatives." Advances in neural information processing systems 31 (2018): 592-603. https://papers.nips.cc/paper/2018/file/c5ff2543b53f4cc0ad3819a36752467b-Paper.pdf

Acknowledge

If any questions on this repo, please kindly let me know by email(yongjie.wang@ntu.edu.sg)