Code Monkey home page Code Monkey logo

Comments (3)

benedekrozemberczki avatar benedekrozemberczki commented on May 18, 2024 1

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

from rexmex.

cthoyt avatar cthoyt commented on May 18, 2024

Reference implementation in PyKEEN here: https://github.com/pykeen/pykeen/blob/139c3d1db77c9e443d03db5383a163297345adfd/src/pykeen/evaluation/rank_based_evaluator.py#L468-L478

from rexmex.

mberr avatar mberr commented on May 18, 2024

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.

from rexmex.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.