Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted mean rank #9

Open
cthoyt opened this issue Nov 12, 2021 · 3 comments
Open

Adjusted mean rank #9

cthoyt opened this issue Nov 12, 2021 · 3 comments

Comments

@cthoyt
Copy link
Contributor

cthoyt commented Nov 12, 2021

@mberr's adjusted mean rank address some of the problems with the mean rank, including its size dependence. Reference: https://arxiv.org/abs/2002.06914

@benedekrozemberczki
Copy link
Contributor

We will add it to the library! Thank you @cthoyt :)

@cthoyt
Copy link
Contributor Author

cthoyt commented Nov 12, 2021

@mberr
Copy link

mberr commented Dec 8, 2021

I am one of the authors and happy to contribute an implementation. To this end, I have a question regarding the existing metrics, e.g.,

def mean_rank(relevant_items: Sequence[X], recommendation: Sequence[X]) -> float:
"""
Calculate the arithmetic mean rank (MR) of items in a ranked list.
Args:
relevant_items: An N x 1 sequence of relevant items.
predicted: An N x 1 sequence of ordered items.
Returns:
: The mean rank of the relevant items in a predicted.
"""

If I understand the API correctly, you assume that there is a single recommendation, a sequence of items, and some of them are relevant (relevant_items). The mean in mean rank is then computed over the relevant items.

This seems to be a bit different than the evaluation protocol frequently used in (Knowledge Graph) Link Prediction, where we have multiple recommendations (e.g. for each head-relation pair), each with relevant items (the tail entities), and compute the mean over all of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants