8000 ENH: interface for SVD solvers · Issue #5585 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

ENH: interface for SVD solvers #5585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
giorgiop opened this issue Oct 24, 2015 · 7 comments
Open

ENH: interface for SVD solvers #5585

giorgiop opened this issue Oct 24, 2015 · 7 comments
Labels
Enhancement help wanted Moderate Anything that requires some knowledge of conventions and best practices module:decomposition

Comments

@giorgiop
Copy link
Contributor

We could make an interface for the different SVD solvers available. See #5299 (comment). See also #5545.

@mfrodl
Copy link
mfrodl commented Oct 25, 2015

I would like to work on that if you let me.

@giorgiop
Copy link
Contributor Author

Go ahead @mfrodl , thanks!

@mfrodl
Copy link
mfrodl commented Nov 17, 2015

So, if I understand correctly, what we need is a function (named, say, _svd()) that will be called from PCA._fit_full() and PCA._fit_truncated() (perhaps even directly from PCA._fit()) and depending on the value of PCA.svd_solver, it will call one of scipy.linalg.svd(), sklearn.utils.arpack.svds() or sklearn.utils.extmath.randomized_svd().

I am currently considering two options where this function should be located: either in sklearn.utils.extmath or as a method of the PCA class. There are at least three PCA class variables whose values _svd() needs to know: mean_, random_state and iterated_power. They could be passed as arguments to the function, as it currently is with e.g. sklearn.utils.extmath.randomized_svd(), or they could be accessible directly if _svd() were a method.

Do you have any preferences in this matter, @giorgiop?

@giorgiop
Copy link
Contributor Author

I think the idea was even more general. This utility function should be used by all classes and functions in scikit-learn that require SVD factorizations, as a unique interface. Use git grep to search in the code base. PCA is only one of those. Therefore a good place would be extmath, unless somebody has better ideas.

@GaelVaroquaux
Copy link
Member

I am currently considering two options where this function should be located:
either in sklearn.utils.extmath or as a method of the PCA class.

In extmath, because it may be used outside of the scope of a PCA.

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Nov 17, 2015 via email

@ogrisel ogrisel added the Moderate Anything that requires some knowledge of conventions and best practices label Jul 5, 2018
@amueller
Copy link
Member

I would consider closing given the lack of interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement help wanted Moderate Anything that requires some knowledge of conventions and best practices module:decomposition
Projects
None yet
Development

No branches or pull requests

6 participants
0