This is the repository that accompanies the paper "CONFEX: Counterfactual Explanations with Conformal Guarantees"

To install the environments:
conda create -n confexenv python=3.10.15
conda activate confexenv
pip3 install -r requirements.txt

Note that a Gurobi licence is required to run the MILP models.

To generate results:
nohup python3 ./results_script.py --dataset GermanCredit > german_credit.out 2>&1 &
nohup python3 ./results_script.py --dataset AdultIncome > adult_income.out 2>&1 &
nohup python3 ./results_script.py --dataset CaliforniaHousing > california_housing.out 2>&1 &
nohup python3 ./results_script.py --dataset GiveMeSomeCredit > give_me_some_credit.out 2>&1 &
nohup python3 ./results_script.py --dataset GermanCredit --model RandomForest > german_credit_rf.out 2>&1 &
nohup python3 ./results_script.py --dataset AdultIncome --model RandomForest > adult_income_rf.out 2>&1 &
nohup python3 ./results_script.py --dataset CaliforniaHousing --model RandomForest > california_housing_rf.out  2>&1 &
nohup python3 ./results_script.py --dataset GiveMeSomeCredit --model RandomForest > give_me_some_credit_rf.out 2>&1 &

Table 1 and all tables in the appendix are all retrieved from within the path results_path

To generate Figure 1, step through fig_1.ipynb
To generate Figure 2, step through results_notebook.ipynb