Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed nan returned for ndcg, rprec if no relevant docs retrieved #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TSoli
Copy link

@TSoli TSoli commented Dec 11, 2024

I noticed that if no relevant documents are retrieved for a run then NDCG, Rprec and recip_rank all returned nan. For NDCG and Rprec I believe these should be 0 instead. I left recip_rank since it is not obvious which would be preferred here.

I wrote some tests for the fixes I made which ensure that the relevant metrics are 0 if no relevant documents were retrieved or if the documents retrieved were all unlabelled.

Note this is different from #25 since there are relevant documents they were just not retrieved during the run (or up to the depth evaluated). With regards to #25 it seems that the entries for NDCG per query do not exist if there are not relevant documents in the collection. This is not fixed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant