No project description provided
Project description
reranking: fairness/personalization for recommendation and search
reranking provides algorithms to re-rank the ranked items to any specified 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 the same distribution to all user
Taking "recommend candidates to recruiters" as the example (this is the case of LinkedIn Recruiter service stressed in the paper), the search engine rankings 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 product preference distribution for each user (which can be obtained by the purchase log or view log) can be used to re-rank the item rankings by recommendation systems to get a more personalized recommendation.
Installation
$ pip install reranking
Examples
from reranking.algs import Reranking
# Here are the attributes of the top-8 ranked items from a recommendation system
item_attribute = ["a1", "a1", "a1", "a2", "a1", "a1", "a1", "a2"]
# Here is the desired item distribution
desired_distribution = {"a1": 0.5, "a2": 0.5}
# We want items of "a1" and "a2" have equal proportions in top-4
r = Reranking(item_attribute, desired_distribution)
r(k_max=4)
The output is [0, 3, 1, 7]
which is the indices of the top-4 items after re-ranking by the desired distribution.
(item_attribute
has the same order with the ranked items so it contains score 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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5234a5129c29dc852c09be11df30d7702112475a378048aec3db70c70033eb |
|
MD5 | ee8137d3778766a17a9098fa03a70f14 |
|
BLAKE2b-256 | 19f7f127246dc08d7f9b24f920aebf7133cb40e098fb2351ddd0972579f70595 |