mne.decoding.Scaler

class mne.decoding.Scaler(info, with_mean=True, with_std=True)

Standardizes data across channels

Parameters:

info : instance of Info

The measurement info

with_mean : boolean, True by default

If True, center the data before scaling.

with_std : boolean, True by default

If True, scale the data to unit variance (or equivalently, unit standard deviation).

Attributes:

info : instance of Info

The measurement info

ch_mean_ : dict

The mean value for each channel type

std_ : dict

The standard deviation for each channel type

Methods

fit(epochs_data, y) Standardizes data across channels
fit_transform(X[, y]) Fit to data, then transform it
inverse_transform(epochs_data[, y]) Inverse standardization of data across channels
transform(epochs_data[, y]) Standardizes data across channels
__init__(info, with_mean=True, with_std=True)
fit(epochs_data, y)

Standardizes data across channels

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 Scaler

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(epochs_data, y=None)

Inverse standardization of data across channels

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.

transform(epochs_data, y=None)

Standardizes data across channels

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.