mne-tools / mne-tools/mne-python

clustering step_down_p efficiency improvement?

Open
#9,330 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

this is admittedly an edge case, but when running TFCE and the first pass shows that every vertex is part of a significant cluster and should be excluded, there shouldn't even be a second pass, right? Admittedly it only took 1:05 for the second pass (versus 41:36 for the first pass) but honestly I find it odd that the code somehow managed to perform 10k permutations on zero vertices and spent a whole minute doing so.

stat_fun(H1): min=1.805931 max=14.442601
Running initial clustering
Using 73 thresholds from 0.00 to 14.40 for TFCE computation (h_power=2.00, e_power=0.50)
Found 20484 clusters
Permuting 9999 times...
100%|███████████████████████|  : 9999/9999 [41:36<00:00,    4.00it/s]
Computing cluster p-values
Step-down-in-jumps iteration #1 found 20484 clusters to exclude from subsequent iterations
Permuting 9999 times...
100%|███████████████████████|  : 9999/9999 [01:05<00:00,  153.38it/s]
Computing cluster p-values
Step-down-in-jumps iteration #2 found 0 additional clusters to exclude from subsequent iterations
Done.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TFCE step-down-in-jumps implementation associated with step_down_p and reproduce the behavior shown in the issue. The work is done when a run with all vertices excluded does not perform the additional 9,999-permutation pass, while the reported clustering and p-value results remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.