question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should the meaning of default=None be specified?

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
alceballosacommented, Oct 23, 2021

Hi, sklearn.decomposition.SparsePCA was solved in #21421, so you can update the list of sub-issues @ogrisel. PR #21428 will probably get merged soon and addresses MiniBatchSparsePCA and MiniBatchDictionaryLearning.

1reaction
MaggieChegecommented, Oct 23, 2021

@muokicaleb and I will work on sklearn.manifold.spectral_embedding (eigen_solver)

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenMP: default(none) and const variables - Jaka's Corner
The default(none) clause forces a programmer to explicitly specify the data-sharing attributes of all variables in a parallel region.
Read more >
UNITNAME: Specifying the type of unit for mounting a ... - IBM
Explanation: UNITNAME(unitname) is an optional parameter identifying the type of unit that should be specified the first time DFSMShsm requests that a ...
Read more >
Jinja2 template variable if None Object set a default value
User is defined and p.User['first_name'] ) |default("NONE", True) }}. Note the last variable (p.User['first_name']) does not have the if defined test after ...
Read more >
Configuring solr.xml :: Apache Solr Reference Guide
xml (i.e., 0 ), then Solr will default to the port that jetty is listening on, defined by ${jetty.port} . leaderVoteWait. Optional. Default:...
Read more >
pandas.read_csv — pandas 0.20.1 documentation
Intervening rows that are not specified will be skipped (e.g. 2 in this example is skipped). ... index_col : int or sequence or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found