DOC Ensures that top_k_accuracy_score passes numpydoc validation#24259
Merged
thomasjpfan merged 1 commit intoscikit-learn:mainfrom Aug 26, 2022
Merged
Conversation
thomasjpfan
approved these changes
Aug 26, 2022
Member
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you for the PR! LGTM
Also, should I update the jaccard_score's accuracy_score description to match?
I would welcome this update in another PR. When merging, we squash PRs where the title becomes the commit message, so we prefer PRs to be as self contained as possible.
glemaitre
pushed a commit
to glemaitre/scikit-learn
that referenced
this pull request
Sep 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
This pull request addresses #21350.
What does this implement/fix? Explain your changes.
sklearn.metrics._ranking.top_k_accuracy_scorestring fromFUNCTION_DOCSTRING_IGNORE_LISTat docstring's test file.Any other comments?
When I was looking for what exactly to add for the
accuracy_scoredescription I did agrep -r "accuracy_score : " sklearn/metricsand found this 3 instances whereaccuracy_scoreappears on "See Also" section (respectively forjaccard_score,zero_one_lossandhamming_loss):scikit-learn/sklearn/metrics/_classification.py
Lines 745 to 747 in feaf382
scikit-learn/sklearn/metrics/_classification.py
Lines 956 to 960 in feaf382
scikit-learn/sklearn/metrics/_classification.py
Lines 2431 to 2435 in feaf382
As the
zero_one_lossandhamming_lossdescription of theaccuracy_scorelooked more complete I decided to go with theirs for now. To be honest, I don't know what would be the best pattern you prefer. A loat of this "See Also" description are very straightforward, such as:scikit-learn/sklearn/metrics/_classification.py
Line 2436 in feaf382
Also, should I update the
jaccard_score'saccuracy_scoredescription to match? I'm just raising this because I think it would make sense if all the "See Also" descriptions were equal. But I don't know if you are concerned about this.Thanks in advance for the reviews! :D