Skip to content

Option to return NaNs in compute_correlation#404

Merged
snastase merged 8 commits into
brainiak:masterfrom
snastase:fcma-nans
Jan 14, 2019
Merged

Option to return NaNs in compute_correlation#404
snastase merged 8 commits into
brainiak:masterfrom
snastase:fcma-nans

Conversation

@snastase

@snastase snastase commented Jan 10, 2019

Copy link
Copy Markdown
Contributor

I've added a return_nans option to brainiak.fcma.util.compute_correlation. Original behavior was to return float 0.0 correlation for any vectors containing NaNs. Now, if return_nans=False (the default) we the original behavior, but if return_nans=True all zeros are replaced with NaNs before output. This is a very simplistic approach: Another way to do this would be to check the input matrices for NaNs and use this to supply NaNs in the output if return_nans=True. For example, if you somehow got a "true" correlation of zero, this would replace the zero with NaN even if there wasn't a NaN in the input. This PR references issue #400.

@snastase
snastase requested a review from yidawang January 10, 2019 23:00
Comment thread brainiak/fcma/util.py Outdated

@yidawang yidawang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snastase

Copy link
Copy Markdown
Contributor Author

I'm having a hard time understanding the test failures here—seems to be something to do with theano used by test_sssrm...? This is not modified in this PR. Any ideas? @mihaic

@mihaic

mihaic commented Jan 14, 2019

Copy link
Copy Markdown
Member

See PR #408.

@snastase
snastase merged commit d03e7ee into brainiak:master Jan 14, 2019
@snastase
snastase deleted the fcma-nans branch January 14, 2019 21:43
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.

3 participants