Data (included in the data/ folder)
- Adult, Bank, and Heart datasets
- Raw data comes from UCI Machine Learning Repository.
- Compas dataset
- Raw data comes from propublica
- inject_exp_all() function in the src/main.py file runs all experiments with injected bias.
- one_exp() function in the src/exp.py file has the main pipeline for each experiment.
- inject_bias() function in the src/exp.py file injects bias to the training data.
- FairBalance() function in the src/preprocessor.py file balances the class distribution within each demographic group.
- Metrics class in the src/metrics.py file calculates the metrics of accuracy, f1 score, EOD, and AOD.
- Install dependencies:
pip install -r requirements.txt
- Navigate to the source code:
cd src
- Generate results in inject_results/
python main.py inject_exp_all