lenskit.metrics.Metric#

class lenskit.metrics.Metric#

Bases: ABC

Base class for LensKit metrics. Individual metrics need to implement a sub-interface, such as ListMetric and/or GlobalMetric.

For simplicity in the analysis code, you cannot simply implement the properties of this class on an arbitrary class in order to implement a metric with all available behavior such as labeling and defaults; you must actually extend this class. This requirement may be relaxed in the future.

__init__()#

Methods

Attributes

label

The metric's default label in output.

property label: str#

The metric’s default label in output.

The base implementation returns the class name by default.