lenskit.metrics.reranking#
LensKit reranking metrics.
Functions#
|
Compute the Least Item Promoted (LIP) metric. |
|
Computes the Rank Biased Overlap (RBO) between two item rankings. |
Package Contents#
- lenskit.metrics.reranking.least_item_promoted(reference, reranked, n=10)#
Compute the Least Item Promoted (LIP) metric.
This metric identifies the item in the top-k reranked list that had the highest (worst) rank in the reference, and returns how many positions it was promoted from beyond k.
- Parameters:
reference (lenskit.data.ItemList) – The original/base ranking.
reranked (lenskit.data.ItemList) – The reranked list.
n (int) – The depth to evaluate (default 10).
- Returns:
The rank distance of the least-promoted item, or NaN if the base ranking is empty.
- Stability:
Experimental
- Return type:
- lenskit.metrics.reranking.rank_biased_overlap(reference, reranked, weight=None, n=10)#
Computes the Rank Biased Overlap (RBO) between two item rankings. RBO is defined by Webber et al. [WMZ10].
- Parameters:
reference (lenskit.data.ItemList) – The first item list to compare.
reranked (lenskit.data.ItemList) – The second item list to compare.
weight (lenskit.metrics.RankWeight | None) – The rank weighting to use. If None, defaults to GeometricRankWeight(0.85).
n (int) – The depth to which to compute the overlap (default 10).
- Returns:
The RBO score between 0 and 1.
- Stability:
Experimental
- Return type: