What does CSP.fit_transform return?

Hi all.

I am working on this example that applies CSP decomposition to a motor imagery task.

In the CSP docs, it’s stated that fit_transform method “Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.”. In that particular example, epochs_data is (45, 64, 801) (epochs, channels, samples)

If I consider 4 CSP components and apply:

epochs_data_transformed = csp.fit_transform(epochs_data, labels)

the dimension of the transformed variable is (45, 4) (epochs, CSP_components).

However, I was expecting to retrieve a CSP filtered variable with dimension (45, 4, 801). Can someone shed some light on what the transformed variable represents? How do I obtain the CSP filtered epochs so I can estimate metrics in the projected space?

Thanks in advance,
Eduardo

CSP aggregates the last dimension with a log of the variance (log if log param is true)

see parameter transform_into and log in the CSP class

Alex

In your case @eduardo, you would need to have self.transform_into == 'csp_space'. You can set transform_into='csp_space' when constructing the CSP object.

All clear now.
Thanks a lot @agramfort and @mmagnuski