Skip to content
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

support for implicitly scaling/centering sparse matrix #73

Closed
robmaz opened this issue Oct 1, 2019 · 4 comments
Closed

support for implicitly scaling/centering sparse matrix #73

robmaz opened this issue Oct 1, 2019 · 4 comments

Comments

@robmaz
Copy link

@robmaz robmaz commented Oct 1, 2019

irlba has center= and scale= arguments to implicitly scale and center matrices while calculating the partial svd. This is super useful for large sparse matrices, because centering explicitly beforehand would usually turn them into dense matrices and make the svd (or even keeping them in memory) unfeasible.

Do you think this can be supported somehow? I find that Rspectra can still handle some large matrices (~1 billion entries) where irlba already croaks, which is very nice, but principal-component regression basically needs the centering step ...

@yixuan
Copy link
Owner

@yixuan yixuan commented Oct 6, 2019

If I understand correctly you hope this to be implemented in the RSpectra package, right?

@robmaz
Copy link
Author

@robmaz robmaz commented Oct 7, 2019

Ultimately I (and, I guess, most people interested in principal-component regression) would use it via Rspectra, but I think it would need to be implemented on a deeper level, e.g., the crossproduct X*t(X) for sparse matrices, which I have seen somewhere in the algorithm. I do not know how the modified algorithm goes, but it certainly must exploit the fact that instead of 0s, you now have many elements with known fixed values -m/s. Basically a concept of generalized sparsity.

@yixuan
Copy link
Owner

@yixuan yixuan commented Oct 9, 2019

I have added this feature to the development version of RSpectra, see the example here. I just need more time to document and push the new version to CRAN.

@robmaz
Copy link
Author

@robmaz robmaz commented Oct 9, 2019

Wow, that was quick. Thank you very much, I look forward to trying this out.

@robmaz robmaz closed this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.