IndexError with asr.fit() for a [100s-150s] window and sfreq=500 Hz
See original GitHub issueHi,
Thank you for this great library! I am facing a weird problem while trying to use asr.fit(). Following your ASR example, below is the code I want to run:
start_window = 100
end_window = 150
sfreq = 500
asr = ASR(sfreq=sfreq,method='riemann')
train_idx = np.arange(start_window * sfreq, end_window * sfreq, dtype=int)
_, sample_mask = asr.fit(EEG_filt_data[:, train_idx])
But I get the following error:
File ".../EEG_preprocessing.py", line 367, in <module>
_, sample_mask = asr.fit(EEG_filt_data[:, train_idx])
File ".../anaconda3/envs/mne/lib/python3.8/site-packages/meegkit/asr.py", line 173, in fit
clean, sample_mask = clean_windows(
File ".../anaconda3/envs/mne/lib/python3.8/site-packages/meegkit/asr.py", line 393, in clean_windows
clean = np.delete(X, sample_mask2remove, 1)
File "<__array_function__ internals>", line 5, in delete
File ".../anaconda3/envs/mne/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4480, in delete
keep[obj,] = False
IndexError: arrays used as indices must be of integer (or boolean) type
It seems that the problem occurs only in the following situation (I don’t know why):
clean window
of50s
length;start_window
fixed at100
;sfreq
fixed at500
.
Indeed when I change one variable while keeping fixed the others (giving for instance 50
, 100
and 499
) it works fine. Maybe it is due to some kind of multiple relationship?
Versions used:
numpy = 1.20.1
mne = 0.22.1
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
IndexError: list index out of range in model.fit() - Stack Overflow
I am new in using tensorflow. I am trying to train my network with images of shape (16*16). I have divided 3 grayscale...
Read more >Nicolas Barascud python-meegkit Issues - Giters
TRCA has Low Accuracy for Identifying 8 Targets in 16-23 Frequency Range? ... IndexError with asr.fit() for a [100s-150s] window and sfreq=500 Hz....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh that’s right! So the problem occurs only when we have
pyriemann
already installed (from pypi) beforehand. Thank you again. Best.Actually my requirements.txt should already force you to install pyriemann from github, instead of the pipy which conflicts with sklearn:
https://github.com/nbara/python-meegkit/blob/f2fe945acf16b7698b0efa8b8c062afbd65ffb75/requirements.txt#L15