./datasets: Here are the processed ML-1M and LastFM-360K datasets../pretrained_model: Here are the pretrained ML-1M and LastFM-360K MF models. (No fair regularization)./scripts: Here are the training scripts../collaborative_models.py: Recommendation model../MF_DP_fairness.py: For MF pretraining../predict_sst_diff_seed.py: Reconstruction of sensitive attributes using multiple priors../mpr.py: Use MPR for fairness training../fairness_training.py, evaluation.py: Training utilities.DRFO_main_predict_sensitive_with_sst_batch.py: Reconstruction of sensitive attributes for DRFO.DRFO_main_program.py: DRFO fairness training.fairness_training_for_drfo.py: Training utilities for DRFO.
pip install -r requirements.txt
You can download the original dataset from the following links: ml-1m Lastfm-360K, we also provide the processed dataset in the folder ./datasets/
Find the model with the best recommendation performace on the validation set.
on ml-1m
bash ./scripts/pretrain/pretrain_ml_1m_diff_seed.shon Lastfm-360K
bash ./scripts/pretrain/pretrain_Lastfm_360K_diff_seed.shWe also provide the pretrained checkpoints in the folder ./pretrained_model, you can also train your own and put it in the folder.
We first establish a predefined set of prior distributions
on ml-1m
bash ./scripts/predict_sst_seed_batch/run_ml_1m.shon Lastfm-360K
bash ./scripts/predict_sst_seed_batch/run_Lastfm_360K.shWe have a hyper-parameter
on ml-1m
bash ./scripts/MPR_batch/run_ml_1m_safe_thresh_eval_random_init.shon Lastfm-360K
bash ./scripts/MPR_batch/run_lastfm_safe_thresh_eval_random_init.shFirst, run the following script to obtain sensitive-attribute predictions required by DRFO:
bash scripts/DRFO/drfo_pred_sst_ml-1m_paral.sh
bash scripts/DRFO/drfo_pred_sst_lastfm_paral.shNext, launch the training process with:
bash scripts/DRFO/drfo_run_ml-1m.sh
bash scripts/DRFO/drfo_run_lastfm.shWe provide a revised derivation in correction_for_theorem_5.3.pdf, which corrects Theorem 5.3. Note that this correction does not affect the proposed method or the main empirical results.
