Skip to content

Should the meaning of default=None be specified? #17295

@alfaro96

Description

@alfaro96

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 class sklearn.tree.DecisionTreeClassifier, sample_weight=None is documented as:

sample_weight : array-like of shape (n_samples,), default=None
Sample weights. If None, then samples are equally weighted.

However, for the score method it is:

sample_weight : array-like of shape (n_samples,), default=None
Sample weights.

It is okay like that or should be specified always?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions