lenskit.metrics.ranking.RankWeight ================================== .. py:class:: lenskit.metrics.ranking.RankWeight :canonical: lenskit.metrics.ranking._weighting.RankWeight Bases: :py:obj:`abc.ABC` Base class for rank weighting models. This returns *multiplicative* weights, such that scores should be multiplied by the weights in order to produce weighted scores. :Stability: caller .. py:method:: weight(ranks) :abstractmethod: Compute the discount for the specified ranks. Ranks must start with 1. .. py:method:: log_weight(ranks) Compute the (natural) log of the discount for the specified ranks. Ranks must start with 1. .. py:method:: series_sum() Get the sum of the infinite series of this discount function, if known. Some metrics (e.g. :func:`~lenskit.metrics.RBP`) will use this to normalize their measurements.