[Feature]: Add NDCG (Normalized Discounted Cumulative Gain) metric to rec_sys
🚀 Feature
(Follow up to #3569 and #2631)
After adding HitRate@top_k and MRR@top_k metrics for recommendation systems, it makes sense to add NDCG@top_k as well.
NDCG complements MRR by considering all relevant items in the ranking, not just the first one. This makes it useful for:
- Recommendation systems evaluation
- RAG (Retrieval Augmented Generation) pipeline evaluation
- Information retrieval benchmarking
Similar to MRR, the implementation would:
- Follow the same structure as
HitRateandMRR - Support multiple
top_kvalues in a single call - Use ranx as reference implementation for tests
hello @steaphenai, i think i can work on this if you don't mind. also there is existing PR #3346 for this which has done most of the work. So it will be relatively easy to pick on it. what do you say?
@aman-coder03 Thanks for your interest! I've already completed the MRR implementation (#3573) and plan to extend the same structure for NDCG next . There's also some ongoing discussion on top_k in #3568 worth checking out!
@steaphenai i checked the thread, and I think we should wait for top_k wrapper to be finalised and merged, what do you think?
Hi, I'm interested in implementing the NDCG metric for rec_sys. I have experience with PyTorch and would like to work on this. Could you please assign it to me?
@vfdev-5 do you think NDCG would be a valuable addition to rec_sys? If so, should we wait for the top_k wrapper in #3568 to be finalized before implementing it, or can we proceed with the current structure?
Thanks for the update. I'll keep an eye on PR #3568 and wait for @vfdev-5's feedback before I start the implementation. Ready to help whenever you decide on the structure!
Hi, I'm interested in implementing the NDCG metric for rec_sys. I have experience with PyTorch and would like to work on this. Could you please assign it to me?
Happy to collaborate on NDCG. Let's wait for @vfdev-5's feedback first before proceeding
Yes, NDCG will be a good addition. We can proceed with the current codebase keeping in mind the changes to be done using topk wrapper. If we can minimize the migration work, it would be ideal