mne_denoise.dss.TimeShiftDSS#
- class mne_denoise.dss.TimeShiftDSS(*, lag_samples: Sequence[int] | None = None, lag_times: Sequence[float] | None = None, sfreq: float | None = None, n_components: int, rank: int, n_select: int | None = None, component_action: str = 'extract', center: bool = False, distortion_control: str | None = None, reg: float = 1e-09, verbose: bool | str | int | None = None)[source]#
Trial-average DSS in a lag-augmented sensor space.
- Parameters:
lag_samples (sequence of int | None) – Explicit lag grid in samples. It must contain zero and at least one nonzero lag. Positive lags contribute
X(t - lag).lag_times (sequence of float | None) – Explicit lag grid in seconds. Every value must lie on the sampling grid. Exactly one lag representation must be provided.
sfreq (float | None) – Sampling frequency for array data when
lag_timesis used. MNE metadata is authoritative and must agree with a supplied value.n_components (int) – Number of lag-space DSS components to fit. Selection is explicit; there is no in-sample automatic selector.
rank (int) – Explicit whitening rank in the augmented feature space.
n_select (int | None) – Size of the leading component subspace used by
score()and by sensor-spaceretainorsubtract. It is required for those operations; extraction itself can leave it unset.component_action ({'extract', 'retain', 'subtract'}) – Component extraction or sensor-space operation. Sensor operations preserve input shape and leave samples outside the common lag support unchanged.
center (bool) – If
False(default), use source-aligned uncentered second moments. IfTrue, fit one weighted augmented-feature mean and reuse it for every transform. Epoch-wise and transform-batch centering are never performed.distortion_control ({None, 'cca'}) – Optional paper step 7.
'cca'rotates the fitted reproducible subspace to the single variate most correlated with undelayed training data. It returns one component and requiresn_select=1for sensor operations.reg (float) – Relative numerical rank tolerance used by DSS and optional CCA.
Notes
Array input is
(n_channels, n_times, n_epochs). MNE Epochs input is accepted natively. Continuous and Evoked inputs are intentionally rejected by this initial repeated-trial implementation.Lag augmentation is the TSDSS-specific layer. The fitted decomposition is available as
dss_and is an ordinaryDSSconfigured withAverageBias(axis="epochs").Component interpretation and parameter choice require held-out and surrogate validation.
- __init__(*, lag_samples: Sequence[int] | None = None, lag_times: Sequence[float] | None = None, sfreq: float | None = None, n_components: int, rank: int, n_select: int | None = None, component_action: str = 'extract', center: bool = False, distortion_control: str | None = None, reg: float = 1e-09, verbose: bool | str | int | None = None) None[source]#
Methods
__init__(*[, lag_samples, lag_times, sfreq, ...])fit(X[, y, sample_weight])Fit lag-augmented repeated-trial DSS filters.
fit_transform(X[, y])Fit to data, then transform it.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
score(X[, y, sample_weight])Score the leading fitted subspace on held-out repeated trials.
set_fit_request(*[, sample_weight])Configure whether metadata should be requested to be passed to the
fitmethod.set_output(*[, transform])Set output container.
set_params(**params)Set the parameters of this estimator.
set_score_request(*[, sample_weight])Configure whether metadata should be requested to be passed to the
scoremethod.transform(X)Extract components or apply the fitted sensor-space operation.