mne_features.feature_extraction.extract_features

mne_features.feature_extraction.extract_features(X, sfreq, selected_funcs, funcs_params=None, n_jobs=1, ch_names=None, return_as_df=False)

Extraction of temporal or spectral features from epoched EEG signals.

Parameters
Xndarray, shape (n_epochs, n_channels, n_times)

Array of epoched EEG data.

sfreqfloat

Sampling rate of the data.

selected_funcslist of str or tuples

The elements of selected_features are either strings or tuples of the form (str, callable). If an element is of type str, it is the alias of a feature function. The aliases are built from the feature functions’ names by removing compute_. For instance, the alias of the feature function compute_ptp_amp() is ptp_amp. (See the documentation of mne-features). If an element is of type tuple, the first element of the tuple should be a string (name/alias given to a user-defined feature function) and the second element should be a callable (a user-defined feature function which accepts Numpy arrays with shape (n_channels, n_times)). The names/aliases given to user-defined feature functions should not intersect the aliases used by mne-features. If the name given to a user-defined feature function is already used as an alias in mne-features, an error will be raised.

funcs_paramsdict or None (default: None)

If not None, dict of optional parameters to be passed to the feature functions. Each key of the funcs_params dict should be of the form: [alias_feature_function]__[optional_param] (for example: higuchi_fd__kmax).

n_jobsint (default: 1)

Number of CPU cores used when parallelizing the feature extraction. If given a value of -1, all cores are used.

ch_nameslist of str or None (default: None)

If not None, list containing the names of each input channel.

return_as_dfbool (default: False)

If True, the extracted features will be returned as a Pandas DataFrame. The column index is a MultiIndex (see MultiIndex) which contains the alias of each feature function which was used. If False, the features are returned as a 2d Numpy array.

Returns
array-like, shape (n_epochs, n_features)
Fork me on GitHub