-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Should the meaning of default=None be specified? #17295
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
Comments
I think it's good to add if it's unclear. I'm not sure if it's worth adding everywhere? |
I think the meaning of sample_weight=None is pretty clear. Paraphrase it as
"no sample weight". There are other uses of default=None where that
paraphrase doesn't work, and those deserve explicit documentation.
|
E.g. when the default that we want to pass would be a mutable but that we cannot do that in python. |
@amueller @jnothman @glemaitre Thanks for the quick and clear explanatory answers! If you think it is okay, I will make a list with the functions, methods and classes where the meaning of |
Here the full list:
Most of these functions, method and classes have not being handled in #15761. Therefore, it would be interesting to tackle both issues at the same time to ensure that the API follows the Guidelines for writing documentation. |
Sounds helpful. However, I think things like max_features=None are
reasonably interpreted as "there is no maximum"
|
@jnothman Sounds right. I have made some modifications to the list. Thanks for the feedback! |
I'm going to be working on sklearn.metrics.check_scoring! |
I'm going to tackle some of the unspecified Since that behaviour is related to the
|
Hi, the list of sub-issues should be updated, as the following are solved already:
All the above were solved in #20382. Best, Alberto |
@alceballosa done! |
I will be working on the sklearn.descomposition.SparsePCA, MiniBatchSparsePCA and MiniBatchDictionaryLearning sub-issues for #DataUmbrella. |
@muokicaleb and I will work on |
Working on |
Working on |
|
I'm going to work on sklearn.feature_extraction.text.TfidfVectorizer with @alielkassas |
After working on |
|
The only ones that are left now are the following:
|
I am going to work on |
Working on |
|
@thomasjpfan If I am not mistaken None option is already described for these parameters. If it is true, you can edit alfaro96's list above. Also does it mean that |
@Tialo yes, |
I'm closing this issue as it is completed now. 🎉 Thank you everyone for contributing. |
Maybe related with #15761.
Describe the issue linked to the documentation
I have noticed that when the default is
None
for some parameter or attribute, the meaning is included only in some cases.For instance, for the
fit
method in the classsklearn.tree.DecisionTreeClassifier
,sample_weight=None
is documented as:However, for the
score
method it is:It is okay like that or should be specified always?
The text was updated successfully, but these errors were encountered: