elliot.evaluation.metrics.accuracy.hit_rate package

Submodules

elliot.evaluation.metrics.accuracy.hit_rate.hit_rate module

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

class elliot.evaluation.metrics.accuracy.hit_rate.hit_rate.HR(recommendations: Dict[int, List[Tuple[int, float]]], config, params, eval_objects)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Hit Rate

This class represents the implementation of the Hit Rate recommendation metric. Passing ‘HR’ to the metrics list will enable the computation of the metric.

For further details, please refer to the link

\[\mathrm {HR@K} =\frac{Number \space of \space Hits @K}{|GT|}\]

\(HR\) is the number of users with a positive sample in the recommendation list.

\(GT\) is the total number of samples in the test set.

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

simple_metrics: [HR]
eval_user_metric()[source]

Evaluation function :return: the overall averaged value of Hit Rate per user

static name()[source]

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

Module contents