elliot.evaluation.metrics.fairness.rsp package¶
Submodules¶
elliot.evaluation.metrics.fairness.rsp.rsp module¶
This is the implementation of the Ranking-based Statistical Parity (RSP) metric. It proceeds from a user-wise computation, and average the values over the users.
-
class
elliot.evaluation.metrics.fairness.rsp.rsp.
RSP
(recommendations, config, params, eval_objects, additional_data)[source]¶ Bases:
elliot.evaluation.metrics.base_metric.BaseMetric
Ranking-based Statistical Parity
This class represents the implementation of the Ranking-based Statistical Parity (RSP) recommendation metric.
For further details, please refer to the paper
\[\mathrm {RSP}=\frac{{std}(P(R @ k \mid g=g_{1}), \ldots, P(R @ k \mid g=g_{A}))} {{mean}(P(R @ k \mid g=g_{1}), \ldots, P(R @ k \mid g=g_{A}))}\]\(P(R @ k \mid g=g_{A})) = \frac{\sum_{u=1}^{N} \sum_{i=1}^{k} G_{g_{a}}(R_{u, i})} {\sum_{u=1}^{N} \sum_{i \in I \backslash I_{u}^{+}} G_{g_{a}}(i)}\)
\(\sum_{i=1}^{k} G_{g_{a}}(R_{u, i})\) calculates how many un-interacted items from group {g_a} are ranked in top-𝑘 for user u.
\(\sum_{i \in I \backslash I_{u}^{+}} G_{g_{a}}(i)\) calculates how many un-interacted items belong to group {g_a} for u
To compute the metric, add it to the config file adopting the following pattern:
complex_metrics: - metric: RSP clustering_name: ItemPopularity clustering_file: ../data/movielens_1m/i_pop.tsv