lenskit.metrics.ranking.RankingMetricBase ========================================= .. py:class:: lenskit.metrics.ranking.RankingMetricBase(n = None, *, k = None) :canonical: lenskit.metrics.ranking._base.RankingMetricBase Bases: :py:obj:`lenskit.metrics._base.Metric` Base class for most ranking metrics, implementing an ``n`` parameter for truncation. :param n: Specify the length cutoff for rankings. Rankings longer than this will be truncated prior to measurement. :param k: Deprecated alias for ``n``. :Stability: Caller .. py:attribute:: n :type: int | None :value: None The maximum length of rankings to consider. .. py:property:: k .. py:property:: label Default name — class name, optionally @N. .. py:method:: truncate(items) Truncate an item list if it is longer than :attr:`n`.