Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined feature functions made easy #38

Open
jbschiratti opened this issue Jun 7, 2018 · 1 comment
Open

User-defined feature functions made easy #38

jbschiratti opened this issue Jun 7, 2018 · 1 comment

Comments

@jbschiratti
Copy link
Collaborator

  1. I think that _embed, _filt, _wavelet_coefs (in utils.py) should not be private functions and should be added (along with power_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:
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)
  1. It is implicit that, for any feature function, if sfreq is one of the parameters, then it should be placed first because unless feature_funcs[alias] = partial(func, sfreq) (in _get_feature_funcs) will not work as expected. This should be mentioned in the doc... Or partial(func, sfreq) should be changed for partial(func, **{'sfreq': sfreq}).
@agramfort
Copy link
Member

agramfort commented Jun 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants