roiextract.pipeline.SymmetricOrthogonalization#

class roiextract.pipeline.SymmetricOrthogonalization(n_iter=50, tol=1e-06, use_previous_d=False)#

Symmetric orthogonalization of the input time series. The implementation follows [1] and is based on the mne_connectivity.symmetric_orth() implementation. This step is useful for reducing the effects of signal leakage in source-reconstructed MEG/EEG data.

Parameters:
n_iterint, optional

The maximum number of iterations for the orthogonalization algorithm.

tolfloat, optional

The tolerance for convergence. The algorithm stops when the relative change in the error is below this threshold.

use_previous_dbool, optional

Set this to True to match the MNE-connectivity implementation. By default, only the D matrix from the final iteration is used for calculating the orthogonalization weights. See the reference paper and source code for more details.

Methods

copy()

Create a copy of the pipeline step.

fit(data, **kwargs)

Fit the symmetric orthogonalization step to the provided data.

fit_transform(data)

Fit the step to the provided data and then apply symmetric orthogonalization.

get_names(names)

Get the names of the rows of the weight matrix, which correspond to the orthogonalized components.

get_params()

Get the parameters of the symmetric orthogonalization step as a dictionary.

get_weights()

Get the weight matrix corresponding to the linear transformation defined by the symmetric orthogonalization step.

transform(data)

Apply symmetric orthogonalization to the provided data.

References

copy()#

Create a copy of the pipeline step.

Returns:
copyPipelineStep

A copy of the pipeline step.

fit(data, **kwargs)#

Fit the symmetric orthogonalization step to the provided data.

Parameters:
dataarray

The input data to fit the step to.

Returns:
selfSymmetricOrthogonalization

The fitted instance of the symmetric orthogonalization step.

fit_transform(data)#

Fit the step to the provided data and then apply symmetric orthogonalization.

Parameters:
dataarray

The input data to fit and transform.

get_names(names)#

Get the names of the rows of the weight matrix, which correspond to the orthogonalized components.

Parameters:
nameslist of str | None

Names that correspond to the rows of the input data. These names are used to as the output names for the orthogonalized components.

Returns:
nameslist of str | None

The names of the rows of the weight matrix, which correspond to the orthogonalized components.

get_params()#

Get the parameters of the symmetric orthogonalization step as a dictionary.

Returns:
paramsdict

A dictionary containing the parameters of the symmetric orthogonalization step.

get_weights()#

Get the weight matrix corresponding to the linear transformation defined by the symmetric orthogonalization step.

Returns:
weightsarray

The weight matrix.

transform(data)#

Apply symmetric orthogonalization to the provided data.

Parameters:
dataarray

The input data to transform.

Returns:
transformed_dataarray

The transformed data after applying symmetric orthogonalization.