question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pairwise bootstrap ISC doesn't work

See original GitHub issue

Hi,

I’m using bootstrap_isc with pairwise=True. The first time I ran it, I got the error from assert np.allclose(voxel_iscs, voxel_iscs.T) because my isc_data has nan. When we do a comparison, nan is never equal to nan. So I applied np.nan_to_num(isc_data) and I ran a whole night for a (378, 161032) ISC data, neither any results nor errors. It’s weird.

My questions are:

  1. is assert np.allclose(voxel_iscs, voxel_iscs.T) that necessary to be here? Since nan != nan, whenever we compare two matrices with nans, even if they are identical, we’ll always get False.
  2. what happened to my second try with np.nan_to_num(isc_data)? There is no error so I don’t what was going on. I guess, it just needs more time to do the computation.

Thank you!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
snastasecommented, Jul 31, 2020

@Yibeichan squareform is kind of like a toggle: if you input a distance vector, it outputs the distance matrix; if you input a distance matrix, it outputs the distance vector. Those assert statements probably snuck in there when I was initially writing the code (and hadn’t thought about force='tomatrix'). I don’t think the force='tomatrix' is strictly necessary given the tests in _check_isc_input, but I don’t mind a little redundancy if it makes the squareform easier to interpret.

0reactions
yibeichancommented, Jul 30, 2020

oh yeah, assert voxel_iscs.shape[0] == voxel_iscs.shape[1] only checks the shape, but force='tomatrix' actually returns you a matrix. But I thought a matrix is default if the input is in the correct shape?

I’m just curious when we will get a vector, not a matrix from squareform() if we don’t specify force='tovector'. I mean, do we have to add force='tomatrix' in _check_isc_input?

Read more comments on GitHub >

github_iconTop Results From Across the Web

brainiak/test_isc.py at master - GitHub
Check pairwise and leave-one-out, and summary statistics for ISC. def test_isc_options(): ... Don't tolerate NaNs, should lose zeroeth voxel.
Read more >
Bootstrap Resampling - Amazon AWS
Apply bootstrap resampling to the auto price data as follows: ... You will need to do this pair wise; e.g. between each possible...
Read more >
brainiak package — brainiak 0.11 documentation
Uses subject-wise (not pair-wise) resampling in the pairwise approach. Returns the observed ISC, the confidence interval, and a p-value for the bootstrap ......
Read more >
Pairwise ISC of brain activity. Spatial representation of the...
html#nilearn.datasets.fetch_surf_fsaverage). Only voxels surviving a bootstrap non-parametric test at q < 0.01 FDR corrected are shown. All data shown are ...
Read more >
Bootstrap Methods - SAS Help Center
Because the bootstrap works the same way with a wide variety of statistics ... The TTEST procedure does not support the use of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found