Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
BirkhoffG committed Oct 20, 2023
1 parent b120eb8 commit 5ec864f
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 82 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
_docs/
_proc

*.bak
.gitattributes
Expand Down
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,59 @@
This file will be overwritten by `index.ipynb`
# RoCourseNet: Distributionally Robust Training of a Prediction Aware Recourse Model

[![Arxiv](https://img.shields.io/badge/Arxiv-2206.00700-orange)](https://arxiv.org/pdf/2206.00700.pdf)

This repo contains code to reproduce our paper published at [CIKM 2023](https://arxiv.org/pdf/2206.00700.pdf).

To cite this paper:


```bibtex
@inproceedings{guo2021rocoursenet,
author={Guo, Hangzhi and Jia, Feiran and Chen, Jinghui and Squicciarini, Anna and Yadav, Amulya},
title = {RoCourseNet: Robust Training of a Prediction Aware Recourse Model},
year = {2023},
isbn = {9798400701030},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3583780.3615040},
doi = {10.1145/3583780.3615040},
booktitle = {Proceedings of the 32nd ACM International Conference on Information and Knowledge Management},
numpages = {15},
location = {Birmingham, United Kingdom},
series = {CIKM ’23}
}
```

## Install

This project uses
[jax-relax](https://github.com/BirkhoffG/ReLax/tree/master) (a fast and scalable recourse explanation library).
Ths library is highly scalable and extensible, which enables our experiments to be finished within 30 minutes.
In contrast, a pytorch implementation of RoCourseNet takes around 12 hours to run.

```sh
pip install -e ".[dev]" --upgrade
```

## Run Experiments

Running `scripts.experiment.py` with different arguments will reproduce results in our paper. For example,

1. Train and Evaluate RoCourseNet on Loan Application Dataset:

```sh
python -m scripts.experiment.py -d loan
```

2. Train and Evaluate CounterNet on Loan Application Dataset:

```sh
python -m scripts.experiment.py -m CounterNet -d loan
```

3. Train and Evaluate ROAR on Loan Application Dataset:

```sh
python -m scripts.experiment.py -m ROAR -d loan
```
137 changes: 59 additions & 78 deletions nbs/index.ipynb
Original file line number Diff line number Diff line change
@@ -1,88 +1,69 @@
{
"cells": [
{
"cell_type": "raw",
"metadata": {},
"source": [
"---\n",
"description: Summary description here.\n",
"output-file: index.html\n",
"title: Project name here\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from .core import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This file will become your README and also the index of your documentation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`pip install your_project_name`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to use"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Fill me in please! Don't forget code examples:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1+1"
"# RoCourseNet: Distributionally Robust Training of a Prediction Aware Recourse Model\n",
"\n",
"[![Arxiv](https://img.shields.io/badge/Arxiv-2206.00700-orange)](https://arxiv.org/pdf/2206.00700.pdf)\n",
"\n",
"This repo contains code to reproduce our paper published at [CIKM 2023](https://arxiv.org/pdf/2206.00700.pdf).\n",
"\n",
"To cite this paper:\n",
"\n",
"\n",
"```bibtex\n",
"@inproceedings{guo2021rocoursenet,\n",
" author={Guo, Hangzhi and Jia, Feiran and Chen, Jinghui and Squicciarini, Anna and Yadav, Amulya},\n",
" title = {RoCourseNet: Robust Training of a Prediction Aware Recourse Model},\n",
" year = {2023},\n",
" isbn = {9798400701030},\n",
" publisher = {Association for Computing Machinery},\n",
" address = {New York, NY, USA},\n",
" url = {https://doi.org/10.1145/3583780.3615040},\n",
" doi = {10.1145/3583780.3615040},\n",
" booktitle = {Proceedings of the 32nd ACM International Conference on Information and Knowledge Management},\n",
" numpages = {15},\n",
" location = {Birmingham, United Kingdom},\n",
" series = {CIKM ’23}\n",
"}\n",
"\n",
"```\n",
"\n",
"## Install\n",
"\n",
"This project uses \n",
"[jax-relax](https://github.com/BirkhoffG/ReLax/tree/master) (a fast and scalable recourse explanation library).\n",
"Ths library is highly scalable and extensible, which enables our experiments to be finished within 30 minutes.\n",
"In contrast, a pytorch implementation of RoCourseNet takes around 12 hours to run.\n",
"\n",
"```sh\n",
"pip install -e \".[dev]\" --upgrade\n",
"```\n",
"\n",
"## Run Experiments\n",
"\n",
"Running `scripts.experiment.py` with different arguments will reproduce results in our paper. For example,\n",
"\n",
"1. Train and Evaluate RoCourseNet on Loan Application Dataset:\n",
"\n",
"```sh\n",
"python -m scripts.experiment.py -d loan\n",
"```\n",
"\n",
"2. Train and Evaluate CounterNet on Loan Application Dataset:\n",
"\n",
"```sh\n",
"python -m scripts.experiment.py -m CounterNet -d loan\n",
"```\n",
"\n",
"3. Train and Evaluate ROAR on Loan Application Dataset:\n",
"\n",
"```sh\n",
"python -m scripts.experiment.py -m ROAR -d loan\n",
"```\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
'n_epochs': 100,
"batch_size": 256,
# 'n_epochs': 10,
'monitor_metrics': 'val/val_loss'
# 'monitor_metrics': None#'val/val_loss'
},
'data_dir_list': {
"assets/data/german_credit/org.csv", "assets/data/german_credit/upt.csv"
Expand Down Expand Up @@ -198,7 +198,7 @@
'n_epochs': 50,
"batch_size": 128,
# 'n_epochs': 10,
'monitor_metrics': 'val/val_loss'
'monitor_metrics': None
},
"data_dir_list": [
"assets/data/covarient/org.csv", "assets/data/covarient/upt.csv"
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = 0.0.1

### OPTIONAL ###

requirements = jax-relax<0.2
requirements = jax-relax===0.1.2 lime folktables jax[cpu]<0.4.1
dev_requirements = nbdev jupyter
# console_scripts =

Expand Down

0 comments on commit 5ec864f

Please sign in to comment.