The re-ranking method for a fair recommendation w.r.t both users and items dimension.
- ratings_data.txt: 
user-item interactions (raw file)(by download, from Cornac or another resource) - [DatasetName]_data.txt: This file is a 
k-corefile that the users and items ids are mapped to a new range of indecies. 
All the datasets used in the experiments are in the datasets folder. Each dataset contains several files and a folder including:
- Folder:
- groups: includes two sub-folders, 
itemsandusers, in the items folder we have the item groups (longtail_items.txtandshorthead_items.txt) and in users folder we have two folders (005and020) each includes two user group files, i.e.,active_ids.txtandinactive_ids.txt. 
 - groups: includes two sub-folders, 
 - Files:
- ratings_data.txt
 - [DatasetName]_data.txt
 - [DatasetName]_inters.txt
 - [DatasetName]_train.txt
 - [DatasetName]_test.txt
 - [DatasetName]_tune.txt
 
 
To run them model you need to run the fair_model notebook:
https://colab.research.google.com/github/rahmanidashti/CPFairRecSys/blob/main/fair_model.ipynb
Mohammadmehdi Naghiaei, DECIDE, University of Southern California
Hossein A. Rahmani, Web Intelligence Group, UCL
Yashar Deldjoo, SisInf Lab, Polytechnic University of Bari
If you use our source code, dataset, and experiments for your research or development, please cite the following paper:
@inproceedings{naghiaei2022cpfairness,
  title={CPFair: Personalized Consumer and Producer Fairness Re-ranking for Recommender Systems},
  author={Mohammadmehdi Naghiaei, Hossein A. Rahmani, Yashar Deldjoo},
  booktitle={The 45th International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year={2022}
}
@article{Naghiaei2022PyCPFair,
title = {PyCPFair: A framework for consumer and producer fairness in recommender systems},
journal = {Software Impacts},
pages = {100382},
year = {2022},
issn = {2665-9638},
doi = {https://doi.org/10.1016/j.simpa.2022.100382},
url = {https://www.sciencedirect.com/science/article/pii/S2665963822000835},
author = {Mohammadmehdi Naghiaei and Hossein A. Rahmani and Yashar Deldjoo}
}
If you have any questions, do not hesitate to contact us by h.rahmani@ucl.ac.uk or rahmanidashti@gmail.com, we will be happy to assist.
