This repository serves to open-source the code used in the paper: "Fairness under Covariate Shift: Improving Fairness-Accuracy tradeoff with few Unlabeled Test Samples ".
To avoid any conflict with your existing Python setup, it is suggested to work in a virtual environment with virtualenv
. To install virtualenv
:
pip install --upgrade virtualenv
Create a virtual environment, activate it and install the requirements in requirements.txt
.
virtualenv env
source env/bin/activate
pip install -r requirements.txt
python generate_data_splits.py --ds_name {0} --gamma {1}
Here
{0}: is the dataset name - "arrhythmia", "adult", "communities", "drug"
{2}: gamma - the shift factor for the test set
Similarly, the following command can be used to generate the asymmetric splits
python generate_asymm_splits.py --ds_name {0}
"gamma" values for the groups can be adjusted in "create_asymm_covar_shift" function
To run the model
python main.py --model_type {0} --ds_name {1} --do_train --k_shot {2}
Here
{0}: is the model name - can be assigned to anything of interest, eg - "wass_and_entropy_model"
{1}: dataset name
{2}: the number of unlabelled test samples utilized
The remaining arguments can be found in "arguments.py" file with explanations
This is not an officially supported Google product.
If you find our work relevant, please cite as:
@article{havaldar2023improving,
title={Improving Fairness-Accuracy tradeoff with few Test Samples under Covariate Shift},
author={Havaldar, Shreyas and Chauhan, Jatin and Shanmugam, Karthikeyan and Nandy, Jay and Raghuveer, Aravindan},
journal={arXiv preprint arXiv:2310.07535},
year={2023}
}