Future warning in feature extraction

dear community members;
I’m using compute_pow_freq_bands to extract Power Spectrum feature using mne features.feature extraction.extract features.
The following is my code:

def eeg_feature_extraction(epochs):
bands = {“delta”: [0.5, 3.5],
“theta”: [3.5, 7.5],
“alpha1”: [7.5, 9.5],
“alpha2”: [9.5,12.5],
“beta1”: [12.5, 17.5],
“beta2”: [17.5, 25],
“gamma”: [25,40]}
X_psd_2 = extract_features(X= epochs.get_data(‘all’),
sfreq = epochs.info[‘sfreq’],
#selected_funcs = [‘ptp_amp’]
selected_funcs = [‘pow_freq_bands’],
funcs_params = {‘pow_freq_bands__freq_bands’: bands,
‘pow_freq_bands__normalize’ : True,
‘pow_freq_bands__psd_method’:‘multitaper’},
ch_names=[“Fp1”,“Fp2”,“F7”,“F3”,“Fz”,“F4”,“F8”,“T3”,“C3”,“Cz”,“C4”,“T4”,“T5”,“P3”,“Pz”,“P4”,“T6”,“O1”,“O2”],
return_as_df=True)
features = X_psd_2
features = meanstd_norm(features)
features_array = features.to_numpy(dtype = ‘float32’)
return features

def feature_extractor(data):
all_seg_features = []
epochs = epoch_maker(data)
for item in epochs:
output = eeg_feature_extraction(item)
all_seg_features.append(output)
return all_seg_features

However, despite the fact that my code produces a result, there is a future warning as follows:

warnings.warn(msg, category=FutureWarning)
/usr/local/lib/python3.7/dist-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function get_feature_names is deprecated; get_feature_names is deprecated in 1.0 and will be removed in 1.2. Please use get_feature_names_out instead.

Please assist me with this warning; can I simply disregard it? or is there a flaw in my code?

hi @FRSHT

this is just a warning. You can safely ignore. I’ve started a fix in WIP: use get_feature_names_out from new sklearn if possible by agramfort · Pull Request #77 · mne-tools/mne-features · GitHub is you want to follow

thanks for the heads up on the API change

Alex