-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC Fix doc of defaults in sklearn.utils.sparsefuncs.py #18025
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 Fix doc of defaults in sklearn.utils.sparsefuncs.py #18025
Conversation
Thanks @franslarsson , there are some linting issues that would need to be resolved. |
Thanks for pointing it out, the linting issue is solved. |
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.
A couple of changes to be in line with our documentation guideline.
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Thank you @glemaitre for the review! I have committed your changes. |
Valid numpy dtypes are listed in https://numpy.org/doc/stable/user/basics.types.html and
but we better write it explicitly as float is confusing because it's unclear whether it's C float (i.e. 32 bit) or python float (64 bit). Sorry if this goes in an orthogonal way to @glemaitre 's comments. |
Yep I got a bit sloppy there. @franslarsson Could you mention the NumPy types. |
Absolutely, I will do that. I noticed that for example inplace_csr_row_scale(), np.int64, np.float64 and np.float32 seem all to be valid types and give the same results. Should the requirement that dtype=np.float64 still be documented in the docstring or should that be removed in those cases? What do you prefer? |
We can stipulate a set of potential type |
I would say that it could be handy for the low-level functions while the high-level functions (usually intended for a user) this might be less interesting and omitting the |
@franslarsson Could you fix the part regarding the valid numpy dtype? |
I have committed one suggestion which includes both 32 and 64. I am a bit unsure how to choose between np.float32 and np.float64 (same for np.int32 and np.int64) so let me know if you have other suggestions. :) |
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
Hi @franslarsson do you mind fixing conflicts? Then we can push a bit to merge and close #15761. Thanks a lot for your work so far. |
Hi @cmarmo! I have now fixed the conflicts, sorry for taking so long. Let me know if there is something else that needs to be fixed. |
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 for the PR. LGTM. Could you just remove some blank line that have been added.
Thanks for the review @glemaitre, I have removed the extra blank lines. |
Thanks @franslarsson We should probably backport this PR in 0.24.X for documentation consistency. |
…#18025) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…#18025) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
See #15761
What does this implement/fix? Explain your changes.
This PR change how default values are documented in sklearn.utils.sparsefuncs.py and update docstring according to guideline.
Any other comments?