Simple library to calculate Rank-biased Overlap between two lists
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install rboRank-biased Overlap (RBO)
This project contains a Python implementation of Rank-Biased Overlap (RBO) from: Webber, William, Alistair Moffat, and Justin Zobel. "A similarity measure for indefinite rankings." ACM Transactions on Information Systems (TOIS) 28.4 (2010): 20." (Download).
Introduction
For a more general introduction, please refer to this blog post.
RBO compares two ranked lists, and returns a numeric value between zero and one to quantify their similarity. A RBO value of zero indicates the lists are completely different, and a RBO of one means completely identical. The terms 'different' and 'identical' require a little more clarification.
Given two ranked lists:
A = ["a", "b", "c", "d", "e"]
B = ["e", "d", "c", "b", "a"]
We can see that both of them rank 5 items ("a", "b", "c", "d" and "e"), but with completely opposite order. In this case the similarity between A and B should be larger than 0 (as they contain the same items, namely, conjoint), but smaller than 1 (as the order of the items are different). If there is third ranked list
C = ["f", "g", "h", "i", "j"]
which ranks 5 totally different items, then if we ask for the similarity between A and C, we should expect a value of 0. In such a non-conjoint case, we need to be able to calculate a similarity as well.