recommenders-team / recommenders

Best Practices on Recommendation Systems
https://recommenders-team.github.io/recommenders/intro.html
MIT License
18.47k stars 3.04k forks source link

Added r-precision #2086

Closed daviddavo closed 3 months ago

daviddavo commented 3 months ago

Description

R-precision can be defined as the precision@R, with R being the number of relevant documents for the query [1]. This means that for a certain user which has relevant items, we would ask the recommendation engine for the top recommendations, and see which of them are true positives.

Related Issues

References

[1]: C. D. Manning, P. Raghavan, and H. Schütze, ‘Chapter 8. Evaluation in information retrieval’, in Introduction to information retrieval, New York: Cambridge University Press, 2008, pp. 151–175.

Checklist:

daviddavo commented 3 months ago

I haven't used Spark or PySpark before. I checked out the code, and it seems that in this case the function metrics are imported from PySpark, using RankingMetrics(), which doesn't implement r-precision, so I don't know where to start

miguelgfierro commented 3 months ago

got it, I just created an issue, let's merge, and we will implement the spark version in the future.