from mne_features.utils import power_spectrum
from mne_features.feature_extraction import extract_features
def myspectralfeature(sfreq, data):
psd, _ = power_spectrum(sfreq, data)
...
return ...
selected_funcs = ['mean', 'variance', ('myfunc', myspectralfeature)]
features = extract_features(epochs_data, sfreq, selected_funcs)
_embed,_filt,_wavelet_coefs(in utils.py) should not be private functions and should be added (along withpower_spectrum) to MNE-features' API. The reason for that is that those functions are "building blocks" for user-defined feature functions. For instance, it would be great if they could do:sfreqis one of the parameters, then it should be placed first because unlessfeature_funcs[alias] = partial(func, sfreq)(in_get_feature_funcs) will not work as expected. This should be mentioned in the doc... Orpartial(func, sfreq)should be changed forpartial(func, **{'sfreq': sfreq}).