elliot.evaluation.metrics.accuracy.mar package

Submodules

elliot.evaluation.metrics.accuracy.mar.mar module

This is the implementation of the Mean Average Recall metric. It proceeds from a user-wise computation, and average the values over the users.

class elliot.evaluation.metrics.accuracy.mar.mar.MAR(recommendations, config, params, eval_objects)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Mean Average Recall

This class represents the implementation of the Mean Average Recall recommendation metric. Passing ‘MAR’ to the metrics list will enable the computation of the metric.

For further details, please refer to the link

\[\begin{split}\begin{align*} \mathrm{Recall@N} &= \frac{1}{\mathrm{min}(m,|rel(k)|)}\sum_{k=1}^N P(k) \cdot rel(k) \\ \mathrm{MAR@N}& = \frac{1}{|U|}\sum_{u=1}^{|U|}(\mathrm{Recall@N})_u \end{align*}\end{split}\]

To compute the metric, add it to the config file adopting the following pattern:

simple_metrics: [MAR]
eval_user_metric()[source]

Evaluation function :return: the overall averaged value of Mean Average Recall per user

static name()[source]

Metric Name Getter :return: returns the public name of the metric

Module contents