lenskit.metrics.ranking.GeometricRankWeight#
- class lenskit.metrics.ranking.GeometricRankWeight(patience=0.85)#
Bases:
RankWeightGeometric 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 (Annotated[float, Gt(0.0), Lt(1.0)]) – The patience parameter \(p\).
- Stability:
- Caller (see Stability Levels).
- weight(ranks)#
Compute the discount for the specified ranks.
Ranks must start with 1.
- Return type:
lenskit.data.types.NPVector[numpy.float64]
- log_weight(ranks)#
Compute the (natural) log of the discount for the specified ranks.
Ranks must start with 1.
- Return type:
lenskit.data.types.NPVector[numpy.float64]