This repository includes the implementation for User-oriented Fairness in Recommendation: Yunqi Li, Hanxiong Chen, Zuohui Fu, Yingqiang Ge, and Yongfeng Zhang. 2021. User-oriented Fairness in Recommendation. In Proceedings of the Web Conference 2021 (WWW'21).
For inquiries contact Yunqi Li ([email protected]) or Hanxiong Chen ([email protected]) or Yongfeng Zhang ([email protected])
@inproceedings{li2021user,
title={User-oriented Fairness in Recommendation},
author={Yunqi Li, Hanxiong Chen, Zuohui Fu, Yingqiang Ge, and Yongfeng Zhang},
booktitle={Proceedings of the the Web Conference 2021},
year={2021}
}
Python 3.6.6
Packages:
pandas==0.24.2
Gurobi==9.0.2
Gurobi is a commercial optimization solver. To run our code, please first install Gurobi and purchase a license. Without a license or fail to install properly, our code will not be able to run.
- The processed datasets are in
./dataset/
- Amazon Datasets: The origin dataset can be found here.
- For each dataset directory contains processed splitted testing datasets for re-ranking.
- 0.05_count_*_test_ratings.txt: grouping by total number of interactions.
- sum_0.05_price_*_test_ratings.txt: grouping by total consumption.
- max_0.05_price_*_test_ratings.txt: grouping by maximum price.
- Sample rank files generated by NCF and biasedMF are provided under each dataset directory. Please decompress each .tar.gz file under its directory before running the code.
- To run the code, please put the ranking file generated by recommendation model under the corresponding dataset folder. For example, to run model with 5Beauty-rand dataset, put the "*_rank.csv" file under "dataset/5Beauty-rand/" directory.
- Ranking csv file format: uid \t iid \t score \t label
- uid: user id column
- iid: item id column
- score: predicted score column
- label: 0 or 1 to indicate this is a negative sample or positive sample
- Before running the code, please update the info of "src/model.py" in "__main__" section. You need to update dataset_name, model_name, group_name_title, group_1_file, group_2_file.
- group_name_title: select from "0.05" (interaction), "max_0.05"(max price) and "sum_0.05"(total consumption)
- group_1_file: select from "_count_active_test_ratings.txt" (interaction), "_price_active_test_ratings.txt" (max price/total consumption)
- group_2_file: select from "_count_inactive_test_ratings.txt" (interaction), "_price_inactive_test_ratings.txt" (max price/total consumption)
- You can chage the variable epsilon to control the strictness for fairness.
> cd user-fairness/src/
> python model.py
The result file will be located in ./results/ by default.