lenskit.metrics.basic.ListLength#

class lenskit.metrics.basic.ListLength#

Bases: lenskit.metrics._base.ListMetric

Report the length of the output (recommendation list or predictions).

Stability:
Caller (see Stability Levels).
label = 'N'#

The metric’s default label in output. The base implementation returns the class name by default.

measure_list(recs, test)#

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

Parameters:
Return type:

float