-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
DOC Ensures that load_wine passes numpydoc #22469
DOC Ensures that load_wine passes numpydoc #22469
Conversation
…oved to the beginning of function documentation
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.
@sharmadharmpal Thanks for the PR :D
I left one comment with something to change.
Also, try to keep the length of the documentation lines to less than 80 characters. I think it is not a written rule, yet it is something that is applied in most of the project code. Maybe someone else can correct me on this.
Finally, it'd be great if we add items for each of the data
return attributes. You can look to this PR for reference. You have to do something like:
"""
Returns
-------
data : :class:`~sklearn.utils.Bunch`
Dictionary-like object, with the following attributes:
- data : {ndarray, dataframe} of shape (178, 13)
The data matrix. If `as_frame=True`, `data` will be a pandas
DataFrame.
"""
sklearn/datasets/_base.py
Outdated
A tuple of two ndarrays. The first contains a 2D array of shape (178, 13) | ||
with each row representing one sample and each column representing the features. | ||
The second array of shape (178,) contains the target samples. |
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.
This is not the case when as_frame=True
where data
and target
are pandas objects.
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.
This is a good point that we let passed in other PRs :)
So I would propose ndarray or dataframe
or ndarray or series
?
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.
This is not the case when
as_frame=True
wheredata
andtarget
are pandas objects.
This PR is an example of the wording we used to take this point into account
Since moving to the |
It was my first change in open source. It have copied from other's comments in the code and modified according to function definition, next time will try as recommended.. |
It's Ok @sharmadharmpal. |
Hi @jmloyola can you please confirm below is correct? Or please guide me.
|
It's fine. I'd only add in the beginning:
|
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.
Thanks @sharmadharmpal
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Reference Issues/PRs
Addresses #21350
What does this implement/fix? Explain your changes.
DOC Ensures that load_wine passes numpydoc validation
Any other comments?
No
Thank You