lenskit.metrics.Recall#
- class lenskit.metrics.Recall(k=None)#
Bases:
ListMetric,RankingMetricBaseCompute recommendation recall. This is computed as:
\[\frac{|L \cap I_u^{\mathrm{test}}|}{\operatorname{min}\{|I_u^{\mathrm{test}}|, k\}}\]- Parameters:
k (int | None)
Methods
__init__([k])extract_list_metrics(data, /)Return the given per-list metric result.
measure_list(recs, test)Compute the metric value for a single result list.
summarize(values, /)Summarize per-list metric values
truncate(items)Truncate an item list if it is longer than
k.Attributes
defaultkThe maximum length of rankings to consider.
The metric's default label in output.
- property label#
The metric’s default label in output. The base implementation returns the class name by default.