You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a docstring-related pull request (#24259) I noticed that, sometimes, the See Also description for the same function/class does not match. For instance, the accuracy_score description was different depending on the class I looked at:
Those where the description is related to the current class/function;
For instance, inside the RegressorChain class, ClassifierChain is described as the "equivalent" version. That is a different description from the one we see inside MultiOutputClassifier, but inside the context of the RegressorChain class, it makes sense.
det_curve: Compute error rates for different probability thresholds.
Suggest a potential alternative/fix
I was planning on taking a closer look at the output table I get with the differences in the descriptions and coming up with the list of functions/classes that we should change to make it uniform across different occurrences of See Also.
Then, as this is a fairly beginner friendly issue, I would edit the issue description and give it a step-by-step (copying most part of what @thomasjpfan did in #21350) and let folks looking for a "good first issue" help. I would be happy to make sure the task bullets are up to date.
What do the maintainers think? Does it make sense? :)
PS: Of course, we will be forever vulnerable to this kind of issue if we don't create a test (maybe adapted from my gist). The problem here is that sometimes it just makes sense to have different descriptions... We can create an "ignore list" maybe, but we can discuss this later.
The text was updated successfully, but these errors were encountered:
I don't know if we should define this issue as a priority. The difference with other documentation issues is that, in most cases, the description is correct.
Describe the issue linked to the documentation
While working on a docstring-related pull request (#24259) I noticed that, sometimes, the See Also description for the same function/class does not match. For instance, the
accuracy_score
description was different depending on the class I looked at:scikit-learn/sklearn/metrics/_classification.py
Lines 745 to 747 in feaf382
scikit-learn/sklearn/metrics/_classification.py
Lines 956 to 960 in feaf382
I decided to investigate it further and see if it was occuring elsewhere (click here to check the gist where I regexed the raw files). Today, at commit 2f8b8e7f1, we have 56 functions/classes that have some sort of different descriptions at some See Also. From looking at them at first glance I have sorted the differences I get into 4 categorys:
Those where the description is related to the current class/function;
RegressorChain
class,ClassifierChain
is described as the "equivalent" version. That is a different description from the one we see insideMultiOutputClassifier
, but inside the context of theRegressorChain
class, it makes sense.scikit-learn/sklearn/multioutput.py
Lines 965 to 967 in 2f8b8e7
Those related to extra "\n" on the text;
scikit-learn/sklearn/kernel_approximation.py
Line 106 in 2f8b8e7
scikit-learn/sklearn/kernel_approximation.py
Lines 292 to 293 in 2f8b8e7
Those that are different per se;
accuracy_score
descriptions we mentioned earlier have no obvious reason to be different.Those that are related to the docstring pattern.
scikit-learn/sklearn/metrics/_ranking.py
Line 961 in 2f8b8e7
Suggest a potential alternative/fix
I was planning on taking a closer look at the output table I get with the differences in the descriptions and coming up with the list of functions/classes that we should change to make it uniform across different occurrences of See Also.
Then, as this is a fairly beginner friendly issue, I would edit the issue description and give it a step-by-step (copying most part of what @thomasjpfan did in #21350) and let folks looking for a "good first issue" help. I would be happy to make sure the task bullets are up to date.
What do the maintainers think? Does it make sense? :)
PS: Of course, we will be forever vulnerable to this kind of issue if we don't create a test (maybe adapted from my gist). The problem here is that sometimes it just makes sense to have different descriptions... We can create an "ignore list" maybe, but we can discuss this later.
The text was updated successfully, but these errors were encountered: