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
FIX improve error message when computing NDCG with a single document #25672
FIX improve error message when computing NDCG with a single document #25672
Conversation
@adrinjalali @glemaitre If you'd give some feedback, it would be much appreciated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will also need an entry in the changelog (file doc/whats_new/1.3.rst
)
It should be in the metrics
section and we can consider this as a Fix
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The changes around L1689-1691 are not related to this PR, but I personally don't mind either way.
Please add a changelog entry in this file https://github.com/scikit-learn/scikit-learn/blob/main/doc/whats_new/v1.3.rst
NDCG is a metric to rank search request or such. A document is just the one input that you want to grade. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We miss an entry in the changelog to acknowledge the bug fix.
Could you add an entry in the file doc/whats_new/v1.3.rst
.
It should be in the metrics
section and be added as a Fix.
Then you can acknowledge whoever participated to solve this bug.
Thanks all. Merging. LGTM |
1 similar comment
Thanks all. Merging. LGTM |
Reference Issues/PRs
Fixes #21335
closes #24482
What does this implement/fix? Explain your changes.
Check that the input array to
ndcg_score()
has a length greater than 1 and throw aValueError
with a meaningful error message if not.Any other comments?
With the gracious help of @wcchu.