Fit Xdawn spatial filters. Parameters ---------- X : array, shape (n_epochs, n_channels, n_samples) The target data. y : array, shape (n_epochs,) | None The target labels. If None, Xdawn fit on the average evoked. Returns ----
(self, X, y=None)
| 169 | _validate_type(self.info, (Info, None), "info") |
| 170 | |
| 171 | def fit(self, X, y=None): |
| 172 | """Fit Xdawn spatial filters. |
| 173 | |
| 174 | Parameters |
| 175 | ---------- |
| 176 | X : array, shape (n_epochs, n_channels, n_samples) |
| 177 | The target data. |
| 178 | y : array, shape (n_epochs,) | None |
| 179 | The target labels. If None, Xdawn fit on the average evoked. |
| 180 | |
| 181 | Returns |
| 182 | ------- |
| 183 | self : Xdawn instance |
| 184 | The Xdawn instance. |
| 185 | """ |
| 186 | X, y = self._check_data(X, y=y, fit=True, return_y=True) |
| 187 | # For test purposes |
| 188 | if y is None: |
| 189 | y = np.ones(len(X)) |
| 190 | self._validate_params(X) |
| 191 | |
| 192 | super().fit(X, y) |
| 193 | |
| 194 | return self |
| 195 | |
| 196 | def transform(self, X): |
| 197 | """Transform data with spatial filters. |