-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fix outlier handling in qap when len(seeds)==n #754
Merged
bdpedigo
merged 6 commits into
graspologic-org:dev
from
kellymarchisio:outlier-handling
Apr 10, 2021
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
372d3e1
Fix outlier handling in qap when len(seeds)==n
kellymarchisio 71c44ac
add unit tests for outlier handling in qap
kellymarchisio bd8752e
Update tests/test_match.py
kellymarchisio 576ac35
update unit tests for outlier handling in qap
kellymarchisio b23bd37
Merge branch 'outlier-handling' of https://github.com/kellymarchisio/…
kellymarchisio 3c3e5f0
Merge branch 'dev' into outlier-handling
bdpedigo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,24 @@ def test_barycenter_SGM(self): | |
score = chr12c.score_ | ||
assert 11156 == score | ||
|
||
W1 = np.array(range(n)) | ||
W2 = [pi[z] for z in W1] | ||
chr12c = self.barycenter.fit(A, B, W1, W2) | ||
score = chr12c.score_ | ||
assert 11156 == score | ||
|
||
W1 = np.array(range(n)) | ||
W2 = [pi[z] for z in W1] | ||
# Shuffle seed pairs. | ||
pairs = [i for i in zip(W1, W2)] | ||
random.shuffle(pairs) | ||
W1 = list(list(zip(*pairs))[0]) | ||
W2 = list(list(zip(*pairs))[1]) | ||
kellymarchisio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
chr12c = self.barycenter.fit(A, B, W1, W2) | ||
score = chr12c.score_ | ||
assert 11156 == score | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you check the |
||
|
||
def test_rand_SGM(self): | ||
A, B = self._get_AB() | ||
chr12c = self.rand.fit(A, B) | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does
sorted
require partial_match to be a list?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope - it can be any iterable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great. can you add a test to the function
test_barycenter_SGM
in test_match.py that gives (a possibly shuffled) fullpartial_match
and returns the correctscore_
andperm_inds
? (Should be very similar to the test in lines 138-142)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - done :)