mne_denoise.sns.SNS#

class mne_denoise.sns.SNS(n_neighbors: int = 0, skip: int = 0, rcond: float = 1e-12, preserve_mean: bool = False, verbose: bool | str | int | None = None, n_iter: int = 1, outlier_threshold: float | None = None, chunk_size: int | None = None)[source]#

Sensor Noise Suppression estimator.

The estimator fits a channel mean and one or more spatial projection operators on training data. Both are fixed during transform. It accepts MNE Raw, Epochs, and Evoked objects or channel-first arrays and implements the SNS algorithm described in [1].

Parameters:
  • n_neighbors (int, default=0) – Neighbours used per channel. Zero uses all available neighbours.

  • skip (int, default=0) – Most-correlated neighbours to skip.

  • rcond (float, default=1e-12) – Relative pseudoinverse cutoff.

  • preserve_mean (bool, default=False) – Restore the fitted training channel mean after regeneration.

  • verbose (bool | str | int | None) – MNE-style logging level.

  • n_iter (int, default=1) – Number of successive SNS projections to learn and compose.

  • outlier_threshold (float | None, default=None) – Maximum robust z-score retained while fitting. None disables automatic rejection.

  • chunk_size (int | None, default=None) – Samples per chunk for statistics and operator application. MNE inputs are still materialized by the package’s shared extractor.

training_mean_#

Weighted channel mean learned during fit.

Type:

ndarray, shape (n_channels, 1)

denoising_matrix_#

Composite spatial operator.

Type:

ndarray, shape (n_channels, n_channels)

denoising_matrices_#

One spatial operator per iteration.

Type:

tuple of ndarray

neighbor_ranks_per_iteration_#

Local neighbor covariance ranks for every iteration.

Type:

tuple of ndarray

References

[1]

de Cheveigné, A., & Simon, J. Z. (2008). Sensor noise suppression. Journal of Neuroscience Methods, 168(1), 195-202. https://doi.org/10.1016/j.jneumeth.2007.09.012

__init__(n_neighbors: int = 0, skip: int = 0, rcond: float = 1e-12, preserve_mean: bool = False, verbose: bool | str | int | None = None, n_iter: int = 1, outlier_threshold: float | None = None, chunk_size: int | None = None) None[source]#

Methods

__init__([n_neighbors, skip, rcond, ...])

fit(X[, y, sample_weight])

Learn fitted means and SNS operators from X.

fit_transform(X[, y, sample_weight])

Fit on X and apply the fitted operator.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

set_fit_request(*[, sample_weight])

Configure whether metadata should be requested to be passed to the fit method.

set_output(*[, transform])

Set output container.

set_params(**params)

Set the parameters of this estimator.

transform(X[, y])

Apply the fitted SNS operator.