elliot.evaluation.metrics.accuracy.precision package

Submodules

elliot.evaluation.metrics.accuracy.precision.precision module

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

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

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Precision-measure

This class represents the implementation of the Precision recommendation metric.

For further details, please refer to the link

\[\mathrm {Precision@K} = \frac{|Rel_u \cap Rec_u|}{Rec_u}\]

\(Rel_u\) is the set of items relevant to user \(U\),

\(Rec_u\) is the top K items recommended to users.

We obtain the result by calculating the average \(Precision@K\) of each user.

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

simple_metrics: [Precision]
eval_user_metric()[source]

Evaluation function :return: the overall averaged value of Precision

static name()[source]

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

Module contents

This is the Precision metric module.

This module contains and expose the recommendation metric.