mne.decoding.EpochsVectorizer

class mne.decoding.EpochsVectorizer(*args, **kwargs)

EpochsVectorizer transforms epoch data to fit into a scikit-learn pipeline.

Parameters:

info : instance of Info

The measurement info.

Attributes

n_channels (int) The number of channels.
n_times (int) The number of time points.

Methods

__hash__() <==> hash(x)
fit(epochs_data, y) For each epoch, concatenate data from different channels into a single feature vector.
fit_transform(X[, y]) Fit to data, then transform it
inverse_transform(X[, y]) For each epoch, reshape a feature vector into the original data shape
transform(epochs_data[, y]) For each epoch, concatenate data from different channels into a single feature vector.
__hash__() <==> hash(x)
fit(epochs_data, y)

For each epoch, concatenate data from different channels into a single feature vector.

Parameters:

epochs_data : array, shape (n_epochs, n_channels, n_times)

The data to concatenate channels.

y : array, shape (n_epochs,)

The label for each epoch.

Returns:

self : instance of EpochsVectorizer

returns the modified instance

fit_transform(X, y=None, **fit_params)

Fit to data, then transform it

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:

X : numpy array of shape [n_samples, n_features]

Training set.

y : numpy array of shape [n_samples]

Target values.

Returns:

X_new : numpy array of shape [n_samples, n_features_new]

Transformed array.

inverse_transform(X, y=None)

For each epoch, reshape a feature vector into the original data shape

Parameters:

X : array, shape (n_epochs, n_channels * n_times)

The feature vector concatenated over channels

y : None | array, shape (n_epochs,)

The label for each epoch. If None not used. Defaults to None.

Returns:

epochs_data : array, shape (n_epochs, n_channels, n_times)

The original data

transform(epochs_data, y=None)

For each epoch, concatenate data from different channels into a single feature vector.

Parameters:

epochs_data : array, shape (n_epochs, n_channels, n_times)

The data.

y : None | array, shape (n_epochs,)

The label for each epoch. If None not used. Defaults to None.

Returns:

X : array, shape (n_epochs, n_channels * n_times)

The data concatenated over channels