-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TST Add test for documentation of the classes_ attribute #16277
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
TST Add test for documentation of the classes_ attribute #16277
Conversation
Nice first step, as you can see in https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=12718&view=ms.vss-test-web.build-test-results-tab, the failed tests are the ones I was talking about in #16273. |
Just to be clear, I would suggest fixing the tests in this PR, for CheckingClassifier, it can be skipped because it is only used for tests, so it is probably not necessary to "force" some documentation on it. |
contributes to #14312 for HistGradientBoostingClassifier attribute classes_ |
Co-Authored-By: Alexandre Gramfort <[email protected]>
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.
Looks good, only one small comment:
sklearn/utils/_mocking.py
Outdated
|
||
Attributes | ||
---------- | ||
classes_ : array, shape = (n_classes,) |
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.
That is the only thing I am not sure about ...
Should we "force" the documentation on some classes that are only used for tests like CheckingClassifier
? I would be enclined to skip the test instead but I don't have a strong opinion.
An alternative is to do a minimal documentation as was done for the parameters a few lines above, i.e.:
Attributes
----------
classes_
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.
ok. Definitely more consistent with the parameter documentation. Doing it right now.
don't know about skipping the test.
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.
The minimal documentation approach is simpler, so let's do this and see whether others have a different opinion.
…ithub.com/judithabk6/scikit-learn into add_test_doc_classes_attribute_estimators
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
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.
Thank you for the PR @judithabk6 !
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, thanks @judithabk6 !
…n#16277) Co-authored-by: Alexandre Gramfort <[email protected]>
…n#16277) Co-authored-by: Alexandre Gramfort <[email protected]>
adding a test to ensure the classes_ attribute is documented in all classifiers.
towards #16273
was originally implemented in PR #12509 by @jrbourbeau