Skip to content

Add 'side' option to randomization tests#477

Merged
mihaic merged 4 commits into
brainiak:masterfrom
snastase:test-tail
Aug 12, 2020
Merged

Add 'side' option to randomization tests#477
mihaic merged 4 commits into
brainiak:masterfrom
snastase:test-tail

Conversation

@snastase

Copy link
Copy Markdown
Contributor

This adds a side (possible values: two-tailed, right, left) option to be passed to p_from_null in the ISC randomization tests for determining whether the p-value output is one- or two-tailed (based on conversations with @me-sh). Previously, two-tailed was hardcoded into the randomization tests. I've also set the default to right, since effectively all ISC analyses are seeking positive correlation (and negative correlations are pretty nonsensical in ISC analysis).

@CameronTEllis

Copy link
Copy Markdown
Contributor

Great looks good Sam, do you have any recommendations for reviewers?

@snastase

Copy link
Copy Markdown
Contributor Author

This is a fairly straightforward change, so probably anybody could review. Not sure @me-sh is available; maybe if @tristansyates is actively running ISCs right now, they could eyeball this as well?

@tristansyates tristansyates left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a fairly straightforward change, so probably anybody could review. Not sure @me-sh is available; maybe if @tristansyates is actively running ISCs right now, they could eyeball this as well?

Great change! Everything looks good to me

@mihaic

mihaic commented Aug 11, 2020

Copy link
Copy Markdown
Member

@snastase, does this fix #466?

@snastase

Copy link
Copy Markdown
Contributor Author

@snastase, does this fix #466?

No, we're still working on #466. That one's a bit more tricky. I don't think the code is "wrong" per se; it's more of a statistical question about which sort of randomization yields a null distribution that best controls false positive rates.

@mihaic

mihaic commented Aug 11, 2020

Copy link
Copy Markdown
Member

Got it. We included #466 in the next release milestone. Do you have an estimate for agreeing on a way to close it?

Comment thread brainiak/isc.py
Number of permutation iteration (randomizing group assignment)

side : str, default: 'two-sided'
Perform one-sided ('left' or 'right') or 'two-sided' test

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.

The side default described in this docstring is not the default assigned in the function declaration.

More generally, we should not describe defaults in the docstrings because their presence in declarations makes them visible both in the Python built-in help function and the HTML docs:

python3 -c "import brainiak.isc; help(brainiak.isc.permutation_isc)"

https://brainiak.org/docs/brainiak.html#brainiak.isc.permutation_isc

Comment thread brainiak/isc.py

side : str, default: 'two-sided'
Perform one-sided ('left' or 'right') or 'two-sided' test

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.

Same comment about default.

Comment thread brainiak/isc.py Outdated
n_shifts : int, default: 1000
Number of randomly shifted samples

side : str, default: 'two-sided'

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.

Same comment about default.

@snastase

Copy link
Copy Markdown
Contributor Author

Thanks @mihaic—good catch! I didn't realize this about defaults in the docstring... so should I remove the default: x statements from the docstrings throughout in this PR?

@mihaic

mihaic commented Aug 12, 2020

Copy link
Copy Markdown
Member

I think we should have dedicated PRs for such cleanups. For now, lets just not add more default descriptions, so just remove the ones part of the diff.

@snastase

Copy link
Copy Markdown
Contributor Author

Okay, I removed the defaults from the docstring for each occurrence of this side argument.

@mihaic mihaic merged commit b0deac2 into brainiak:master Aug 12, 2020
mihaic pushed a commit that referenced this pull request Sep 2, 2020
The main part of this PR was already merged in PR #477.
8e557d4
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.

4 participants