Skip to content

jizhi-zhang/MPR

Repository files navigation

Fair Recommendation with Biased Limited Sensitive Attribute

Intro

Folder & File structure

  • ./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.

Environment:

pip install -r requirements.txt

Dataset

You can download the original dataset from the following links: ml-1m Lastfm-360K, we also provide the processed dataset in the folder ./datasets/

1. Pretrain MF model

Find the model with the best recommendation performace on the validation set.

on ml-1m

bash ./scripts/pretrain/pretrain_ml_1m_diff_seed.sh

on Lastfm-360K

bash ./scripts/pretrain/pretrain_Lastfm_360K_diff_seed.sh

We also provide the pretrained checkpoints in the folder ./pretrained_model, you can also train your own and put it in the folder.

2. Create Multiple priority

We first establish a predefined set of prior distributions $\mathcal{P}$, which in our setting is ${ 1/10.0, 1/9.5, 1/9.0, \cdots, 1/1.5, 1, 1.5, 2, \cdots, 9.5, 10 }$. We then estimate the distribution of users’ sensitive attributes under each prior distribution $\hat{p}_0 \in \mathcal{P}$ by resampling the known sensitive attributes.

on ml-1m

bash ./scripts/predict_sst_seed_batch/run_ml_1m.sh

on Lastfm-360K

bash ./scripts/predict_sst_seed_batch/run_Lastfm_360K.sh

3. Multiple Priority Robust Optimization

We have a hyper-parameter $\beta$ in our optimization objective. In general, as $\beta$ decreases, the fairness metrics improve.

on ml-1m

bash ./scripts/MPR_batch/run_ml_1m_safe_thresh_eval_random_init.sh

on Lastfm-360K

bash ./scripts/MPR_batch/run_lastfm_safe_thresh_eval_random_init.sh

[Optional] The strong baseline DRFO:

First, 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.sh

Next, launch the training process with:

bash scripts/DRFO/drfo_run_ml-1m.sh
bash scripts/DRFO/drfo_run_lastfm.sh

Theoretical Note

We 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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors