Project CSP features back to sensor space. Parameters ---------- X : array, shape (n_epochs, n_components) The data in CSP power space. Returns ------- X : ndarray The data in sensor space and shape (n_epochs, n_channels, n_co
(self, X)
| 307 | return X |
| 308 | |
| 309 | def inverse_transform(self, X): |
| 310 | """Project CSP features back to sensor space. |
| 311 | |
| 312 | Parameters |
| 313 | ---------- |
| 314 | X : array, shape (n_epochs, n_components) |
| 315 | The data in CSP power space. |
| 316 | |
| 317 | Returns |
| 318 | ------- |
| 319 | X : ndarray |
| 320 | The data in sensor space and shape (n_epochs, n_channels, n_components). |
| 321 | """ |
| 322 | if self.transform_into != "average_power": |
| 323 | raise NotImplementedError( |
| 324 | "Can only inverse transform CSP features when transform_into is " |
| 325 | "'average_power'." |
| 326 | ) |
| 327 | if not (X.ndim == 2 and X.shape[1] == self.n_components): |
| 328 | raise ValueError( |
| 329 | f"X must be 2D with X[1]={self.n_components}, got {X.shape=}" |
| 330 | ) |
| 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. |
no outgoing calls
no test coverage detected