lenskit.metrics.ranking.RankWeight#
- class lenskit.metrics.ranking.RankWeight#
Bases:
abc.ABCBase 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 (see Stability Levels).
- abstractmethod weight(ranks)#
Compute the discount for the specified ranks.
Ranks must start with 1.
- Parameters:
ranks (lenskit.data.types.NPVector[numpy.int32])
- 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.
- Parameters:
ranks (lenskit.data.types.NPVector[numpy.int32])
- Return type:
lenskit.data.types.NPVector[numpy.float64]