elliot.evaluation.metrics.accuracy.f1 package

Submodules

elliot.evaluation.metrics.accuracy.f1.extended_f1 module

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

class elliot.evaluation.metrics.accuracy.f1.extended_f1.ExtendedF1(recommendations, config, params, eval_objects, additional_data)[source]

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

Extended F-Measure

This class represents the implementation of the F-score recommendation metric. Passing ‘ExtendedF1’ to the metrics list will enable the computation of the metric.

“Evaluating Recommender Systems” Gunawardana, Asela and Shani, Guy, In Recommender systems handbook pages 265–308, 2015

For further details, please refer to the paper

\[\mathrm {ExtendedF1@K} =\frac{2}{\frac{1}{\text { metric_0@k }}+\frac{1}{\text { metric_1@k }}}\]
Parameters
  • metric_0 – First considered metric (default: Precision)

  • metric_1 – Second considered metric (default: Recall)

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

complex_metrics:
- metric: ExtendedF1
  metric_0: Precision
  metric_1: Recall
eval_user_metric()[source]
get()[source]
static name()[source]

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

process()[source]

Evaluation function :return: the overall value of Bias Disparity

elliot.evaluation.metrics.accuracy.f1.f1 module

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

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

Bases: elliot.evaluation.metrics.base_metric.BaseMetric

F-Measure

This class represents the implementation of the F-score recommendation metric. Passing ‘F1’ to the metrics list will enable the computation of the metric.

For further details, please refer to the paper

\[\mathrm {F1@K} = \frac{1+\beta^{2}}{\frac{1}{\text { precision@k }}+\frac{\beta^{2}}{\text { recall@k }}}\]

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

simple_metrics: [F1]
eval_user_metric()[source]

Evaluation function :return: the overall averaged value of F-score

static name()[source]

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

Module contents