pyeeg.cca.CCA_Estimator.transform

CCA_Estimator.transform(transform_x=True, transform_y=False, comp=0)

Project the data onto the canonical components.

Applies the fitted canonical coefficients to the (lagged, saved) feature matrix X to obtain the canonical scores of the stimulus side. The response-side projection is currently not implemented (the corresponding code is commented out).

Parameters:
  • transform_x (bool, default: True) – Whether to project the stimulus features X onto the canonical components.

  • transform_y (bool, default: False) – Whether to project the response y onto the canonical components. Not currently implemented.

  • comp (int, default: 0) – Index of the canonical component used for the projection when transform_x is True.

Returns:

Projected data: canonical scores of the (lagged) features, of shape (nsamples x nchans) – the result of coefResponse_.T @ coefStim_.T @ X.

Return type:

ndarray