mne.decoding.TimeDelayingRidge

class mne.decoding.TimeDelayingRidge(tmin, tmax, sfreq, alpha=0.0, reg_type='ridge', fit_intercept=True)[source]

Ridge regression of data with time delays.

Parameters:
tmin : int | float

The starting lag, in seconds (or samples if sfreq == 1). Negative values correspond to times in the past.

tmax : int | float

The ending lag, in seconds (or samples if sfreq == 1). Positive values correspond to times in the future. Must be >= tmin.

sfreq : float

The sampling frequency used to convert times into samples.

alpha : float

The ridge (or laplacian) regularization factor.

reg_type : str | list

Can be “ridge” (default) or “laplacian”. Can also be a 2-element list specifying how to regularize in time and across adjacent features.

fit_intercept : bool

If True (default), the sample mean is removed before fitting.

Notes

This class is meant to be used with mne.decoding.ReceptiveField by only implicitly doing the time delaying. For reasonable receptive field and input signal sizes, it should be more CPU and memory efficient by using frequency-domain methods (FFTs) to compute the auto- and cross-correlations.

Methods

__hash__($self, /) Return hash(self).
fit(X, y) Estimate the coefficients of the linear model.
get_params([deep]) Get parameters for this estimator.
predict(X) Predict the output.
set_params(**params) Set the parameters of this estimator.
__hash__($self, /)

Return hash(self).

fit(X, y)[source]

Estimate the coefficients of the linear model.

Parameters:
X : array, shape (n_samples[, n_epochs], n_features)

The training input samples to estimate the linear coefficients.

y : array, shape (n_samples[, n_epochs], n_outputs)

The target values.

Returns:
self : instance of TimeDelayingRidge

Returns the modified instance.

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters:
deep : boolean, optional

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

Returns:
params : mapping of string to any

Parameter names mapped to their values.

predict(X)[source]

Predict the output.

Parameters:
X : array, shape (n_samples[, n_epochs], n_features)

The data.

Returns:
X : ndarray

The predicted response.

set_params(**params)[source]

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