-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
PCA random_state documentation doesn't cover all options #17291
Description
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.