Skip to content

Make random_state descriptions more informative and refer to Glossary #10548

Closed

Description

@jnothman

We recently added a Glossary to our documentation, which describes common parameters among other things. We should now replace descriptions of random_state parameters to make them more concise and informative (see #10415). For example, instead of

    random_state : int, RandomState instance or None, optional, default: None
        If int, random_state is the seed used by the random number generator;
        If RandomState instance, random_state is the random number generator;
        If None, the random number generator is the RandomState instance used
        by `np.random`.

in both KMeans and MiniBatchKMeans, we might have:

KMeans:
    random_state : int, RandomState instance, default=None
        Determines random number generation for centroid initialization.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.


MiniBatchKMeans:
    random_state : int, RandomState instance, default=None
        Determines random number generation for centroid initialization and
        random reassignment.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

Therefore, the description should focus on what is the impact of random_state on the algorithm.

Contributors interested in contributing this change should take on one module at a time, initially.

The list of estimators to be modified is the following:

List of files to modify using kwinata script

Activity

  1. added
    good first issue
    on Jan 29, 2018
  2. aby0 commented on Jan 29, 2018

    @aby0
    Contributor

    Hi @jnothman, Can I take this issue? Thanks

  3. jnothman commented on Jan 29, 2018

    @jnothman
    MemberAuthor
  4. aby0 commented on Jan 29, 2018

    @aby0
    Contributor

    @jnothman I am sorry for being naive but can you elaborate about the module/submodule? I mean are you referring to a sub-package like Kmeans for instance?

  5. lesteve commented on Jan 29, 2018

    @lesteve
    Member

    I think what @jnothman means is just start with one file, for example sklearn/cluster/k_means_.py, update the random_state docstring as in the top post and open a PR.

  6. jnothman commented on Jan 29, 2018

    @jnothman
    MemberAuthor
  7. aby0 commented on Jan 30, 2018

    @aby0
    Contributor

    Thanks. Will do that and open a PR.

  8. jnothman commented on Jan 30, 2018

    @jnothman
    MemberAuthor
  9. jnothman commented on Jan 31, 2018

    @jnothman
    MemberAuthor
  10. 46 remaining items

  11. DatenBiene commented on Jan 30, 2020

    @DatenBiene
    Contributor

    Claim :
    sklearn/mixture/_bayesian_mixture.py - 166
    sklearn/mixture/_base.py - 139
    sklearn/mixture/_gaussian_mixture.py - 504

  12. DatenBiene commented on Jan 30, 2020

    @DatenBiene
    Contributor

    Claim sklearn/ensemble/_gb.py - 887, 1360

  13. DatenBiene commented on Jan 30, 2020

    @DatenBiene
    Contributor

    Claim sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py - 736, 918

  14. GregoireMialon commented on Jan 30, 2020

    @GregoireMialon
    Contributor

    Claim sklearn/neural_network/_rbm.py - 59

  15. DatenBiene commented on Jan 30, 2020

    @DatenBiene
    Contributor

    Claim :

    sklearn/svm/_classes.py - 90, 312, 546, 752
    sklearn/svm/_base.py - 853

  16. DatenBiene commented on Jan 30, 2020

    @DatenBiene
    Contributor

    Claim:

    sklearn/feature_selection/_mutual_info.py - 226, 335, 414
    sklearn/metrics/cluster/_unsupervised.py - 80
    sklearn/utils/_testing.py - 521
    sklearn/utils/init.py - 478, 623

  17. DatenBiene commented on Jan 31, 2020

    @DatenBiene
    Contributor

    Claim :

    sklearn/dummy.py - 59
    sklearn/random_projection.py - 178, 245, 464, 586

  18. jeremiedbb commented on Feb 12, 2020

    @jeremiedbb
    Member

    @DatenBiene @GregoireMialon Thanks for all your contributions during last sprint. There are only 3 modules left unchecked !

    Would you be interested / have time / have motivation to tackle those (no pressure !) ?

  19. GregoireMialon commented on Feb 13, 2020

    @GregoireMialon
    Contributor
  20. DatenBiene commented on Apr 4, 2020

    @DatenBiene
    Contributor

    Hi @jeremiedbb! I will try to finish the 3 remaining modules today 😃

    Claim:

    sklearn/kernel_approximation.py - 41, 143, 470
    sklearn/multiclass.py - 687
    sklearn/ensemble/_base.py - 52

  21. DatenBiene commented on Apr 16, 2020

    @DatenBiene
    Contributor

    Hi @jnothman and @jeremiedbb, looks like all the files where modified. I would be happy to help if you find any remaining issues.

  22. cmarmo commented on Apr 16, 2020

    @cmarmo
    Contributor

    Thanks a lot @DatenBiene and all the contributors that worked to close this issue!
    I think we can close this huge one!
    Feel free to open new specific issues if something is still missing about random_state description.

  23. added a commit that references this issue on Apr 18, 2026
    f6923a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationModerateSprintgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions