No project description provided
Project description
Reranking: fairness/personalization for recommendation and search
reranking provides algorithms to re-rank the items to any desired item attribute distribution.
This package can be used as a post-processing modular of recommendation system or search engine.
Inspired by paper Fairness-Aware Ranking in Search & Recommendation Systems with Application to LinkedIn Talent Search.
Concept of usage
Fairness: impose a same distribution to the ranking of each user
Taking "recommend candidates to recruiters" as the example (this is the case of LinkedIn Recruiter service stressed in the paper), the search engine ranking are re-ranked by the distribution of the protected attributes like gender and demographic parity in consideration of the fair display of the candidates to recruiters.
Personalization: impose personalized distribution to each user based on their preference
For example, when we recommend products to users, the products preference distribution for each user (i.e., obtained by the purchase or view log) can be used to re-rank the output item rankings by recommendation systems.
Installation
$ pip install reranking
Examples
from reranking.algs import Reranking
r = Reranking(["f1", "f1", "f1", "f2", "f1", "f1", "f1", "f2"], {"f1": 0.5, "f2": 0.5})
r(k_max=4) # we want "f1" and "f2" have equal proportion in top-4
The output is [0, 3, 1, 7]
which is the indices of the top-4 items after re-ranking by the desired distribution.
(The input feature list is corresponding to the ranked items so it contains score/ranking information.)
More examples can be found here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for reranking-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1485faeefd5096b434c99a8ae7f55d9329fe463990caefb062f7d96097df8470 |
|
MD5 | f10b7b5c59a20ac0fd6f42e89c5c9ed2 |
|
BLAKE2b-256 | 6c3d69bc0ef49af115ad953d791debd1ded39d547126f31a3856e91e58844741 |