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

(s)PCA Build using RSpectra::svds() #251

Closed
wants to merge 12 commits into from
Closed

(s)PCA Build using RSpectra::svds() #251

wants to merge 12 commits into from

Conversation

Max-Bladen
Copy link
Collaborator

Imported the RSpectra::svds() function to both pca() and spca().

  • For both, the output values are consistent.
  • In the case of the former, run time is significantly improved.
  • In the case of the latter, runtime is only marginally improved. This is due to the spca() function being highly inefficient generally. The SVD calculations are only one aspect of this inefficiency.

refactor: import and utilise RSpectra::svds() instead of base::svd().

svds() only calculates the required number of left and right singular vector as eigenvalues. svd() calculates an excessive amount which can cause runtime inflation for large datasets
refactor: import and utilise RSpectra::svds() instead of base::svd(). This is now also applied to spca()
docs: updated NAMESPACE and DESCRIPTION to include new dependency
@Max-Bladen Max-Bladen self-assigned this Oct 6, 2022
@Max-Bladen Max-Bladen added the bug-fix For PR's that address an Issue with `bug` label label Oct 6, 2022
@Max-Bladen Max-Bladen linked an issue Oct 6, 2022 that may be closed by this pull request
Max-Bladen and others added 2 commits October 7, 2022 10:03
docs: updated DESCRIPTION with new import
tests: increased suffix length in `plotLoadings()` label-length check
@Max-Bladen
Copy link
Collaborator Author

Required rebase to master branch after resolution of Issue #252 (via PR #253)

refactor: import and utilise RSpectra::svds() instead of base::svd().

svds() only calculates the required number of left and right singular vector as eigenvalues. svd() calculates an excessive amount which can cause runtime inflation for large datasets
refactor: import and utilise RSpectra::svds() instead of base::svd(). This is now also applied to spca()
docs: updated NAMESPACE and DESCRIPTION to include new dependency
docs: updated DESCRIPTION with new import
fix: when ILR/CLR was used, X was of invalid class. Added check to ensure `svds()` can operate on X
fix: when ILR/CLR was used, X was of invalid class. Added check to ensure `svds()` can operate on X. Implemented this for `spca()`
@Max-Bladen Max-Bladen changed the title Fix for Issue #250 (s)PCA Build using RSpectra::svds() Oct 7, 2022
@Max-Bladen Max-Bladen removed the bug-fix For PR's that address an Issue with `bug` label label Oct 7, 2022
@Max-Bladen
Copy link
Collaborator Author

Really weird issue arising preventing the checks from passing. Honestly, not worth the effort in trying to resolve as this is a PR generated for a single user from the MIG lab.

@Max-Bladen Max-Bladen closed this Oct 16, 2022
@Max-Bladen Max-Bladen deleted the issue-250 branch November 16, 2022 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inflated runtime on (s)PCA
1 participant