lenskit.metrics.ListMetric#
- class lenskit.metrics.ListMetric#
Bases:
MetricBase class for metrics that measure individual recommendation (or prediction) lists, and whose results may be aggregated to compute overall metrics.
For prediction metrics, this is macro-averaging.
- Default behavior:
Implements summarize() by averaging per-list results (mean, ignoring NaNs).
This class implements the Metric interface in terms of the measure_list method.
- Stability:
- Full (see Stability Levels).
- __init__()#
Methods
__init__()extract_list_metrics(data, /)Return the given per-list metric result.
measure_list(output, test, /)Compute the metric value for a single result list.
summarize(values, /)Summarize per-list metric values
Attributes
defaultlabelThe metric's default label in output.
- abstractmethod measure_list(output, test, /)#
Compute the metric value for a single result list.
Individual metric classes need to implement this method.
- extract_list_metrics(data, /)#
Return the given per-list metric result.