Fit CSP to data, then transform it. Fits transformer to ``X`` and ``y`` with optional parameters ``fit_params``, and returns a transformed version of ``X``. Parameters ---------- X : array, shape (n_epochs, n_channels, n_times) The data on which
(self, X, y=None, **fit_params)
| 331 | return X[:, np.newaxis, :] * self.patterns_[: self.n_components].T |
| 332 | |
| 333 | def fit_transform(self, X, y=None, **fit_params): |
| 334 | """Fit CSP to data, then transform it. |
| 335 | |
| 336 | Fits transformer to ``X`` and ``y`` with optional parameters ``fit_params``, and |
| 337 | returns a transformed version of ``X``. |
| 338 | |
| 339 | Parameters |
| 340 | ---------- |
| 341 | X : array, shape (n_epochs, n_channels, n_times) |
| 342 | The data on which to estimate the CSP. |
| 343 | y : array, shape (n_epochs,) |
| 344 | The class for each epoch. |
| 345 | **fit_params : dict |
| 346 | Additional fitting parameters passed to the :meth:`mne.decoding.CSP.fit` |
| 347 | method. Not used for this class. |
| 348 | |
| 349 | Returns |
| 350 | ------- |
| 351 | X_csp : array, shape (n_epochs, n_components[, n_times]) |
| 352 | If ``self.transform_into == 'average_power'`` then returns the power of CSP |
| 353 | features averaged over time and shape is ``(n_epochs, n_components)``. If |
| 354 | ``self.transform_into == 'csp_space'`` then returns the data in CSP space |
| 355 | and shape is ``(n_epochs, n_components, n_times)``. |
| 356 | """ |
| 357 | # use parent TransformerMixin method but with custom docstring |
| 358 | return super().fit_transform(X, y=y, **fit_params) |
| 359 | |
| 360 | @legacy(alt="get_spatial_filter_from_estimator(clf, info=info).plot_patterns()") |
| 361 | @fill_doc |
no outgoing calls