-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
sklearn.decomposition.PCA svd_solver='auto' should default to "arpack" for sparse input #7642
Description
I'm using sklearn version 0.18
When using sklearn.decomposition.PCA on a scipy.sparse, the value provided in the svd_solver parameter must be "arpack" (which is the only algorithm supporting sparse input).
the default svd_solver value, "auto" presumes to pick an appropriate default value depending on other input parameters (such as matrix shape and n_components).
It would be helpful if "auto" will also take sparsity into consideration.
Additionally, svd_solver value "full" (or "auto" that picks "full") yields the following error:
TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.
It would be helpful if the error included a suggestion to use svd_solver value of "arpack" as a potential fix.