[Mne_analysis] Error in extract_features

Alexandre Gramfort alexandre.gramfort at inria.fr
Sat Apr 20 03:48:03 EDT 2019
Search archives:

        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

On Sat, Apr 20, 2019 at 6:26 AM Senaka Amarakeerthi <senakahks at gmail.com> wrote:
>
>         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.
>
> On Fri, Apr 19, 2019 at 4:54 PM Alexandre Gramfort <alexandre.gramfort at inria.fr> wrote:
>>
>>         External Email - Use Caution
>>
>> hi,
>>
>> do the examples we provide work? does it break only with your data?
>>
>> Alex
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis



More information about the Mne_analysis mailing list