Skip to content

PCA random_state documentation doesn't cover all options #17291

Closed

Description

@crispinlogan

Describe the issue linked to the documentation

On PCA documentation page https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html under random_state it says 'Used when svd_solver == ‘arpack’ or ‘randomized’.'. Strictly speaking it is actually sometimes also used when svd_solver == 'auto' (according to the rules laid out in svd_solver parameter description under 'If auto'). So, reading the documentation for the random_state parameter, it can appear that it is not necessary to set the random_state if svd_solver is set to 'auto' (as this case when under svd_solver'== auto' it uses the randomized method is not mentioned there).

Suggest a potential alternative/fix

Under the 'random_state' parameter description, change 'Used when svd_solver == ‘arpack’ or ‘randomized’.'. to 'Used when svd_solver == ‘arpack’ or ‘randomized’, and (if certain conditions are met) when svd_solver == 'auto' (see svd_solver parameter description).'.

Happy to submit a pull request with the change if you think it makes things clearer.

Activity

  1. NicolasHug commented on May 20, 2020

    @NicolasHug
    Member

    I agree that the curent Used when svd_solver == ‘arpack’ or ‘randomized’ is wrong.

    I feel like it could just be

    Used when the ‘arpack’ or ‘randomized’ solvers are used

    It's up to the users to read what 'auto' selects.

  2. crispinlogan commented on May 20, 2020

    @crispinlogan
    ContributorAuthor

    Sure, I also agree with that.

    Shall I open a PR and make the change as you suggest?

  3. NicolasHug commented on May 20, 2020

    @NicolasHug
    Member

    that'd be great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions