mne.decoding.UnsupervisedSpatialFilter#

class mne.decoding.UnsupervisedSpatialFilter(estimator, average=False)[source]#

Use unsupervised spatial filtering across time and samples.

Parameters:
estimatorinstance of sklearn.base.BaseEstimator

Estimator using some decomposition algorithm.

averagebool, default False

If True, the estimator is fitted on the average across samples (e.g. epochs).

Methods

fit(X[, y])

Fit the spatial filters.

fit_transform(X[, y])

Transform the data to its filtered components after fitting.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

inverse_transform(X)

Inverse transform the data to its original space.

set_output(*[, transform])

Set output container.

set_params(**params)

Set the parameters of this estimator.

transform(X)

Transform the data to its spatial filters.

fit(X, y=None)[source]#

Fit the spatial filters.

Parameters:
Xarray, shape (n_epochs, n_channels, n_times)

The data to be filtered.

yNone | array, shape (n_samples,)

Used for scikit-learn compatibility.

Returns:
selfinstance of UnsupervisedSpatialFilter

Return the modified instance.

fit_transform(X, y=None)[source]#

Transform the data to its filtered components after fitting.

Parameters:
Xarray, shape (n_epochs, n_channels, n_times)

The data to be filtered.

yNone | array, shape (n_samples,)

Used for scikit-learn compatibility.

Returns:
Xarray, shape (n_epochs, n_channels, n_times)

The transformed data.

Examples using fit_transform:

Analysis of evoked response using ICA and PCA reduction techniques

Analysis of evoked response using ICA and PCA reduction techniques
get_metadata_routing()[source]#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:
routingMetadataRequest

A MetadataRequest encapsulating routing information.

get_params(deep=True)[source]#

Get parameters for this estimator.

Parameters:
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:
paramsdict

Parameter names mapped to their values.

inverse_transform(X)[source]#

Inverse transform the data to its original space.

Parameters:
Xarray, shape (n_epochs, n_components, n_times)

The data to be inverted.

Returns:
Xarray, shape (n_epochs, n_channels, n_times)

The transformed data.

set_output(*, transform=None)[source]#

Set output container.

See Introducing the set_output API for an example on how to use the API.

Parameters:
transform{“default”, “pandas”, “polars”}, default=None

Configure output of transform and fit_transform.

  • “default”: Default output format of a transformer

  • “pandas”: DataFrame output

  • “polars”: Polars output

  • None: Transform configuration is unchanged

New in v1.4: “polars” option was added.

Returns:
selfestimator instance

Estimator instance.

set_params(**params)[source]#

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:
**paramsdict

Estimator parameters.

Returns:
selfestimator instance

Estimator instance.

transform(X)[source]#

Transform the data to its spatial filters.

Parameters:
Xarray, shape (n_epochs, n_channels, n_times)

The data to be filtered.

Returns:
Xarray, shape (n_epochs, n_channels, n_times)

The transformed data.

Examples using mne.decoding.UnsupervisedSpatialFilter#

Analysis of evoked response using ICA and PCA reduction techniques

Analysis of evoked response using ICA and PCA reduction techniques