elliot.evaluation.metrics.accuracy.mrr package¶
Submodules¶
elliot.evaluation.metrics.accuracy.mrr.mrr module¶
This is the implementation of the Mean Reciprocal Rank metric. It proceeds from a user-wise computation, and average the values over the users.
-
class
elliot.evaluation.metrics.accuracy.mrr.mrr.
MRR
(recommendations, config, params, eval_objects)[source]¶ Bases:
elliot.evaluation.metrics.base_metric.BaseMetric
Mean Reciprocal Rank
This class represents the implementation of the Mean Reciprocal Rank recommendation metric. Passing ‘MRR’ to the metrics list will enable the computation of the metric.
For further details, please refer to the link
\[\mathrm {MRR} = \frac{1}{|{U}|} \sum_{i=1}^{|{U}|} \frac{1}{rank_i}\]\(U\) is the number of users, \(rank_i\) is the rank of the first item in the recommendation list in the test set results for user \(i\).
To compute the metric, add it to the config file adopting the following pattern:
simple_metrics: [MRR]