lenskit.metrics.GeometricRankWeight#
- class lenskit.metrics.GeometricRankWeight(patience=0.85)#
Bases:
RankWeight
Geometric cascade weighting for result ranks.
This is the ranking model used by RBP [MZ08].
For patience \(p\), the discount is given by \(p^{k-1}\). The sum of this infinite series is \(\frac{1}{1 - p}\).
- Parameters:
patience (float) – The patience parameter \(p\).
- Stability:
- Caller (see Stability Levels).
Methods
__init__
([patience])log_weight
(ranks)Compute the (natural) log of the discount for the specified ranks.
Get the sum of the infinite series of this discount function, if known.
weight
(ranks)Compute the discount for the specified ranks.
Attributes
patience
- weight(ranks)#
Compute the discount for the specified ranks.
Ranks must start with 1.
- log_weight(ranks)#
Compute the (natural) log of the discount for the specified ranks.
Ranks must start with 1.