Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Repository
Implementation of Rank-biased Overlap
Basic Info
- Host: GitHub
- Owner: changyaochen
- License: mit
- Language: Python
- Default Branch: master
- Size: 80.1 KB
Statistics
- Stars: 146
- Watchers: 4
- Forks: 17
- Open Issues: 8
- Releases: 0
Metadata Files
README.md
Rank-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.
The RBO measure can handle ranked lists with different lengths as well, with proper extrapolation. For example, the RBO between the list A and list
D = ["a", "b", "c", "d", "e", "f", "g"]
will be 1.
Usage
Installation using pip
To install the RBO module to the current interpreter with Pip:
pip install rbo
Computing RBO
The RankingSimilarity class contains the calculation for the different flavours of RBO, with clear reference to the corresponding equations in the paper.
Below shows how to compute the similarity of two ranked lists S and T:
```python In [1]: import rbo
In [2]: S = [1, 2, 3]
In [3]: T = [1, 3, 2]
In [4]: rbo.RankingSimilarity(S, T).rbo() Out[4]: 0.8333333333333334 ```
Accepted data types are Python lists and Numpy arrays.
Using Pandas series is possible using the underlying Numpy array as shown below. This restriction is necessary, because using [] on a Pandas series queries the index, which might not number items contiguously, or might even be non-numeric.
```python In [1]: import pandas as pd
In [2]: import rbo
In [3]: S = [1, 2, 3]
In [4]: U = pd.Series([1, 3, 2])
In [5]: rbo.RankingSimilarity(S, U.values).rbo() Out[5]: 0.8333333333333334 ```
Computing extrapolated RBO
There is an extension of the vanilla RBO implementation, in which we extrapolate from the visible lists, and assume that the degree of agreement seen up to depth $k$ is continued indefinitely.
This extrapolated version is implemented as the RankingSimilarity.rbo_ext() method.
Development
Refer to the Makefile for supplementary tasks to development, e.g., executing unit tests, or checking for proper packaging. Please let me know if there is any issue.
Owner
- Name: Changyao Chen
- Login: changyaochen
- Kind: user
- Location: New York
- Company: @instacart
- Website: https://changyaochen.github.io
- Repositories: 53
- Profile: https://github.com/changyaochen
GitHub Events
Total
- Watch event: 13
- Issue comment event: 1
- Fork event: 1
Last Year
- Watch event: 13
- Issue comment event: 1
- Fork event: 1
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Changyao Chen | c****n@g****m | 30 |
| Falco Duersch | f****h@s****e | 9 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 9
- Total pull requests: 17
- Average time to close issues: 27 days
- Average time to close pull requests: 12 days
- Total issue authors: 9
- Total pull request authors: 6
- Average comments per issue: 1.89
- Average comments per pull request: 0.53
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 2
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 4 minutes
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- frankier (1)
- ulyngs (1)
- f4lco (1)
- itsmartinhi (1)
- nikozoe (1)
- robertour (1)
- WillSH97 (1)
- rjpbonnal (1)
- crude-coder (1)
Pull Request Authors
- changyaochen (8)
- f4lco (4)
- itsmartinhi (4)
- ucsky (2)
- dependabot[bot] (2)
- DnlRKorn (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 22,206 last-month
- Total dependent packages: 3
- Total dependent repositories: 9
- Total versions: 2
- Total maintainers: 1
pypi.org: rbo
Simple library to calculate Rank-biased Overlap between two lists
- Homepage: https://github.com/changyaochen/rbo
- Documentation: https://rbo.readthedocs.io/
- License: MIT
-
Latest release: 0.1.3
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- astroid 2.4.2 develop
- atomicwrites 1.4.0 develop
- attrs 20.3.0 develop
- autopep8 1.5.6 develop
- colorama 0.4.4 develop
- flake8 3.9.0 develop
- importlib-metadata 3.4.0 develop
- iniconfig 1.1.1 develop
- isort 5.7.0 develop
- lazy-object-proxy 1.4.3 develop
- mccabe 0.6.1 develop
- packaging 20.9 develop
- pluggy 0.13.1 develop
- py 1.10.0 develop
- pycodestyle 2.7.0 develop
- pyflakes 2.3.1 develop
- pylint 2.6.2 develop
- pyparsing 2.4.7 develop
- pytest 6.2.2 develop
- six 1.15.0 develop
- toml 0.10.2 develop
- typed-ast 1.4.2 develop
- typing-extensions 3.7.4.3 develop
- wrapt 1.12.1 develop
- zipp 3.4.0 develop
- numpy 1.20.1
- tqdm 4.59.0
- autopep8 ^1.5.6 develop
- flake8 ^3.8.4 develop
- pylint ^2.6.2 develop
- pytest ^6.2.2 develop
- numpy ^1.18
- python ^3.7
- tqdm ^4.59.0