system
(system)
April 19, 2019, 4:18am
1
External Email - Use Caution
Dear All,
I am trying to extract features from EEG using feature extraction api (
https://mne-tools.github.io/mne-features/api.html )
I am getting following error:
TypeError: set_params() argument after ** must be a mapping, not numpy.ndarray
The code used is below:
selected_funcs = {'std', 'kurtosis','pow_freq_bands'}
pow_freq_bands__freq_bands = array([0.5, 4., 8., 13., 30.])
X_new = extract_features(epochs_data, raw.info['sfreq'], selected_funcs,
pow_freq_bands__freq_bands)
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190419/e9601056/attachment.html
system
(system)
April 19, 2019, 11:23am
2
External Email - Use Caution
hi,
do the examples we provide work? does it break only with your data?
Alex
system
(system)
April 20, 2019, 4:24am
3
External Email - Use Caution
Hi Alex,
This given example working fine for my dataset as well.
selected_funcs = {'std', 'kurtosis'}
pow_freq_bands__freq_bands = array([0.5, 4., 8., 13., 30.])
X_new = extract_features(epochs_data, raw.info['sfreq'], selected_funcs)
The problem comes when I try to select a function which has parameters and
which shoud pass to the extract_features() sepeately. In this case,
pow_freq_bands__freq_bands. Also I couldn't find such examples in internet.
Code which gives the error:
selected_funcs = {'std', 'kurtosis','pow_freq_bands'}
pow_freq_bands__freq_bands = array([0.5, 4., 8., 13., 30.])
X_new = extract_features(epochs_data, raw.info['sfreq'], selected_funcs,
pow_freq_bands__freq_bands)
Thank you.
system
(system)
April 20, 2019, 7:48am
4
External Email - Use Caution
hi,
the syntax should be:
X_new = extract_features(epochs_data, raw.info['sfreq'],
selected_funcs, {'pow_freq_bands__freq_bands': array([0.5, 4., 8.,
13., 30.])})
it's usually a good practice to look at tests to understand the usage.
https://github.com/mne-tools/mne-features/blob/master/mne_features/tests/test_feature_extraction.py#L43
HTH
Alex
system
(system)
April 22, 2019, 9:13am
5
External Email - Use Caution
Dear Alex,
Thank you, That works.
I am from Colombo, Sri Lanka and today only I could check it.
Best regards,
Senaka