Return Singular values (S) from procrustes to assess alignment (rotat… - #70
Open
kbcoulter wants to merge 1 commit into
Open
Return Singular values (S) from procrustes to assess alignment (rotat…#70kbcoulter wants to merge 1 commit into
kbcoulter wants to merge 1 commit into
Conversation
…ion) -align.py: procrustes function now returns R, S instead of R alone - S is the singular values from np.linalg.svd() function, just returned instead of discarded - No inference is conducted here... S is simply returned. -test_align.py: Updated the 3 existing procrustes tests to unpack (R,_), as S is not relavant - Added test_procrustes_singular_value_identity: S == [1,1,1] for X=Y=I - Added test_procrustes_singular_values_are_sorted_nonnegative: shape/non-negativity/descending-order on some random data - NOTE: Breaking signature change...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return Singular values (S) from procrustes and procrustes_scale
The procrustes() function computes
Rvianp.linalg.svd(), but discards the singular valuesS. These values are helpful for assessing the procrustes solution, specifically in determining the unconstrained dims when a rank-deficient matrix is passed..Changes
align.py: Changes to procrustes() function(s)procrustes()now returns(R,S)instead of justRprocrustes_scale()now returns(R, k, S)instead of justRand vectorktest_align.py: Tests Updated/ AddedR, _S(necessary?)test_procrustes_singular_values_identity:S== [1,1,1] for X=Y=Itest_procrustes_singular_values_are_sorted_nonnegative: shape/non-negativity/descending-order on junk dataNOTE: This is a breaking signature change when unpacking procrustes