ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Add MRR (Mean Reciprocal Rank) metric to rec_sys

Open steaphenai opened this issue 9 months ago • 2 comments

closes #3569 Refs #3572

Description: Add MRR (Mean Reciprocal Rank) metric to ignite/metrics/rec_sys.

  • Supports multiple top_k values in a single call
  • Uses torch.argsort with stable=True for deterministic tie-breaking
  • Uses ranx as reference implementation for tests
  • Adds relevance_threshold to support graded relevance labels

Check list:

  • [x] New tests are added (if a new feature is added)
  • [x] New doc strings: description and/or example code are in RST format
  • [ ] Documentation is updated (if required)

steaphenai avatar Feb 22 '26 13:02 steaphenai

@steaphenai please check also this discussion on top k stuff: https://github.com/pytorch/ignite/issues/3568#issuecomment-3939547890

vfdev-5 avatar Feb 22 '26 18:02 vfdev-5

@steaphenai please check also this discussion on top k stuff: #3568 (comment)

Thanks! I've read #3568. The current implementation keeps top_k specific to MRR following the same pattern as HitRate. I'll update if needed once the TopK wrapper approach is decided.

steaphenai avatar Feb 22 '26 18:02 steaphenai

@aaishwarymishra can you review this PR instead of others and make it up to a mergeable state? Thanks!

vfdev-5 avatar Jul 01 '26 09:07 vfdev-5

@vfdev-5 My bad, I missed that there already a pr open :)

aaishwarymishra avatar Jul 01 '26 10:07 aaishwarymishra