No project description provided
Project description
reranking: fairness/personalization for recommendation and search
reranking provides algorithms to re-rank the items from recommendation system/search engine to any desired item attribute distribution.
This package can be used as a post-processing modular of recommendation system/search engine.
Inspired by paper Fairness-Aware Ranking in Search & Recommendation Systems with Application to LinkedIn Talent Search.
Concept of usage
Fairness: impose the same distribution to the items 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 the personalized distributions to each user
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(["a1", "a1", "a1", "a2", "a1", "a1", "a1", "a2"], {"a1": 0.5, "a2": 0.5})
r(k_max=4) # we want items of attribute "a1" and attribute "a2" have equal proportions 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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ea449174a52e429c4ad0ec134e9bd16f206782f93def104165bf525276c8ea5 |
|
MD5 | a150e734cdee2961b3ddb889e427bfad |
|
BLAKE2b-256 | 495afdd655a639f0a0bb2b4b89093e3dd353bd9a5abc709a36848605e85ae99d |