The codes are associated with the following paper:
Path-Specific Counterfactual Fairness for Recommender Systems,
Yaochen Zhu, Jing Ma, Liang Wu, Qi Guo, Liangjie Hong, Jundong Li,
SIGKDD 2023.
The codes are written in Python 3.6.5.
- numpy == 1.16.3
- pandas == 0.21.0
- tensorflow-gpu == 1.15.0
- tensorflow-probability == 0.8.0
-
Acquire the Amazon-VG and ML-1M datasets:
The original datasets can be found [here] and [here].
Preprocess the data with data_sim/raw/prepare_data.py. -
Preprocess the original dataset:
cd to data_sim/raw folder, run
python prepare_data.py --dataset Name --simulate exposure
. -
Fit the binarized rating distributions via VAEs:
cd to data_sim folder, run
python train.py --dataset Name --simulate exposure
. -
Simulate the datasets:
python simulate.py --dataset Name
. -
The simulated datasets are in psf-vae/data folder
This for now is a private dataset.
-
Split the simulated datasets into train/val/test: cd to psf-vae/data folder, run
python preprocess.py --dataset Name --split 10
. -
Train the PSF-VAE model:
python train.py --dataset Name --split [0-9]
-
Evaluate the model based on recommendation performance and fairness:
python eval.py --dataset Name --split [0-9]
-
Summarize the results into a table:
python summarize.py --dataset Name
@inproceedings{Zhu2023Path,
title={Path-Specific Counterfactual Fairness for Recommender Systems},
author={Zhu, Yaochen and Ma, Jing and Wu, Liang and Guo, Qi and Hong, Liangjie and Li, Jundong},
booktitle={Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’23)},
year={2023},
}