ignite icon indicating copy to clipboard operation
ignite copied to clipboard

[Feature]: Add NDCG (Normalized Discounted Cumulative Gain) metric to rec_sys

Open steaphenai opened this issue 9 months ago • 8 comments

🚀 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 HitRate and MRR
  • Support multiple top_k values in a single call
  • Use ranx as reference implementation for tests

steaphenai avatar Feb 23 '26 06:02 steaphenai

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 avatar Feb 23 '26 06:02 aman-coder03

@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 avatar Feb 23 '26 07:02 steaphenai

@steaphenai i checked the thread, and I think we should wait for top_k wrapper to be finalised and merged, what do you think?

aman-coder03 avatar Feb 23 '26 08:02 aman-coder03

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?

mhusnain-tech avatar Feb 24 '26 07:02 mhusnain-tech

@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?

steaphenai avatar Feb 24 '26 08:02 steaphenai

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!

mhusnain-tech avatar Feb 24 '26 08:02 mhusnain-tech

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

steaphenai avatar Feb 24 '26 08:02 steaphenai

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

vfdev-5 avatar Feb 24 '26 08:02 vfdev-5