Git Product home page Git Product logo

peymanrasouli / care Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 17.34 MB

CARE: Coherent Actionable Recourse based on Sound Counterfactual Explanations

License: GNU General Public License v3.0

Python 9.35% Makefile 0.02% HTML 12.82% Batchfile 0.01% Jupyter Notebook 77.79% Shell 0.01% CSS 0.01%
explainable-ai explainable-ml explainability counterfactual-explanations actionable-recourse blackbox-model classification regression multi-objective-optimization dice

care's Introduction

CARE

This repository contains the implementation source code of the following paper:

CARE: Coherent Actionable Recourse based on Sound Counterfactual Explanations

BibTeX:

@article{rasouli2022care,
  title={CARE: Coherent Actionable Recourse based on Sound Counterfactual Explanations},
  author={Rasouli, Peyman and Chieh Yu, Ingrid},
  journal={International Journal of Data Science and Analytics},
  pages={1--26},
  year={2022},
  publisher={Springer}
}

Setup

1- Clone the repository using HTTP/SSH:

git clone https://github.com/peymanrasouli/CARE

2- Install the following package containing GCC/g++ compilers and libraries:

sudo apt-get install build-essential

3- Create a conda virtual environment:

conda create -n CARE python=3.7

4- Activate the conda environment:

conda activate CARE

5- Standing in CARE directory, install the requirements:

pip install -r requirements.txt

Explaining instances

1- To explain a particular instance using CARE, run:

python main.py

2- To explain a particular instance using CARE, CFPrototype, DiCE, and CERTIFAI simultaneously, run:

python care_cfprototype_dice_certifai.py

Explanation Example

An actionable recourse generated by CARE for an instance from Adult data set:

Features Original Instance Actionable Recourse
age 25 30
capital-gain 0 _
capital-loss 0 _
hours-per-week 40 45
work-class Private _
education Bachelors Masters
marital-status Not-in-family _
occupation Sales Prof-specialty
relationship Never-married _
race White _
sex Female _
native-country United-States _
Class <=50K >50K

IF 'age was 30' AND 'hours-per-week was 45' AND 'education was Masters' AND 'occupation was Prof-specialty',

THE PERSON WOULD BE CLASSIFIED AS '>50K income' RATHER THAN '<=50K income'.

Reproducing the validation results

1- To reproduce the results of performance validation of CARE's modules, run:

python care_module_performance.py

2- To reproduce the results of soundness validation, run:

python care_soundness.py

3- To reproduce the results of coherency validation, run:

python care_coherency.py

4- To reproduce the validation results of temporal action sequence, run:

python care_temporal_action_sequence.py

Reproducing the benchmark results

1- To reproduce the results of CARE{VALIDITY} config vs. baselines, run:

python benchmark_validity.py

2- To reproduce the results of CARE{VALIDITY, SOUNDNESS} config vs. baselines, run:

python benchmark_validity_soundness.py

3- To reproduce the results of CARE{VALIDITY, SOUNDNESS, COHERENCY} config vs. baselines, run:

python benchmark_validity_soundness_coherency.py

4- To reproduce the results of CARE{VALIDITY, SOUNDNESS, COHERENCY, ACTIONABILITY} config vs. baselines, run:

python benchmark_validity_soundness_coherency_actionability.py

care's People

Contributors

peyman-ra avatar peymanrasouli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

simonhofer11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.