Code Monkey home page Code Monkey logo

user-fairness's Introduction

user-fairness

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

Refernece

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}
}

Environments

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.

Datasets

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

Run the codes

Prepare input data

  • 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

Modify model.py

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

Run

> cd user-fairness/src/
> python model.py

Result

The result file will be located in ./results/ by default.

user-fairness's People

Contributors

yunqi-li avatar rutgerswiselab avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.