lenskit.metrics.ListMetric ========================== .. py:class:: lenskit.metrics.ListMetric :canonical: lenskit.metrics._base.ListMetric Bases: :py:obj:`Metric`\ [\ :py:obj:`float | None`\ , :py:obj:`lenskit.data.accum.ValueStatistics`\ ] Base class for metrics defined on individual recommendation outputs. This is the most common type of metric. For prediction metrics, this is *macro-averaging*. Metrics based on this class implement :meth:`measure_list` to compute a single numeric value for each list, and the accumulated result will be basic statistical summaries of those values. :Stability: Full .. py:attribute:: default :type: ClassVar[float | None] :value: 0.0 .. py:method:: measure_list(output, test, /) :abstractmethod: Compute measurements for a single list. :returns: - A float for simple metrics - Intermediate data for decomposed metrics - A dict mapping metric names to values for multi-metric classes .. py:method:: extract_list_metrics(data, /) Return the given per-list metric result. .. py:method:: create_accumulator() Creaet an accumulator to aggregate per-list measurements into summary metrics. Each result from :meth:`measure_list` is passed to :meth:`Accumulator.add`.