DOC Ensures that top_k_accuracy_score passes numpydoc validation #24259
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_score
string fromFUNCTION_DOCSTRING_IGNORE_LIST
at docstring's test file.Any other comments?
When I was looking for what exactly to add for the
accuracy_score
description I did agrep -r "accuracy_score : " sklearn/metrics
and found this 3 instances whereaccuracy_score
appears on "See Also" section (respectively forjaccard_score
,zero_one_loss
andhamming_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_loss
andhamming_loss
description of theaccuracy_score
looked 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_score
description 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