I am trying to use the extract_features
function from the mne_features
package to extract some features from EEG data. However, I am getting the following error when I try to run my code:
feature_names = extractor.get_feature_names()
AttributeError: ‘FeatureUnion’ object has no attribute ‘get_feature_names’
The relevant code is also accessible via
Here is the code that I am using:
import mne
import numpy as np
from mne_features.feature_extraction import extract_features
epochs = mne.read_epochs('P_zeroed-epo.fif', preload=True) # the fif file is accessible via the link at the bottom of this post
epochs = epochs.pick_types(eeg=True)
freq_bands = np.array([1.2, 4., 8.0, 13.0, 30.0, 47.0])
ls_feature = ['skewness', 'kurtosis', 'samp_entropy']
funcs_params = dict(pow_freq_bands__psd_method='fft',pow_freq_bands__freq_bands=freq_bands)
feature_s = extract_features(epochs.get_data(), epochs.info['sfreq'],
selected_funcs=ls_feature, return_as_df=True,
ch_names=epochs.ch_names, n_jobs=1)
I have tried to look up the error message, but I haven’t been able to find a solution that works for me. Can anyone help me figure out what is causing this error and how to fix it?
Thank you in advance for your help.
link to the fif file
Spec:
Windows 11
mne: 1.3.0
mne_features: 0.2.1
sklearn: 1.2.1