MCPcopy
hub / github.com/mne-tools/mne-python / transform

Method transform

mne/decoding/ssd.py:273–297  ·  view source on GitHub ↗

Estimate epochs sources given the SSD filters. Parameters ---------- X : array, shape ([n_epochs, ]n_channels, n_times) The input data from which to estimate the SSD. Either 2D array obtained from continuous data or 3D array obtained from epoched

(self, X)

Source from the content-addressed store, hash-verified

271 return self
272
273 def transform(self, X):
274 """Estimate epochs sources given the SSD filters.
275
276 Parameters
277 ----------
278 X : array, shape ([n_epochs, ]n_channels, n_times)
279 The input data from which to estimate the SSD. Either 2D array
280 obtained from continuous data or 3D array obtained from epoched
281 data.
282
283 Returns
284 -------
285 X_ssd : array, shape ([n_epochs, ]n_components, n_times)
286 The processed data.
287 """
288 X = self._check_X(X)
289 # For the case where n_epochs dimension is absent.
290 if X.ndim == 2:
291 X = np.expand_dims(X, axis=0)
292 X_aux = X[..., self.picks_, :]
293 if self.return_filtered:
294 X_aux = filter_data(X_aux, self.sfreq_, **self.filt_params_signal)
295 X_ssd = super().transform(X_aux).squeeze()
296
297 return X_ssd
298
299 def fit_transform(self, X, y=None, **fit_params):
300 """Fit SSD to data, then transform it.

Callers 7

applyMethod · 0.95
test_ssdFunction · 0.95
test_ssd_epoched_dataFunction · 0.95
test_sortingFunction · 0.95
test_return_filteredFunction · 0.95
test_ssd_save_loadFunction · 0.95
test_get_spectral_ratioFunction · 0.95

Calls 2

_check_XMethod · 0.95
filter_dataFunction · 0.85

Tested by 6

test_ssdFunction · 0.76
test_ssd_epoched_dataFunction · 0.76
test_sortingFunction · 0.76
test_return_filteredFunction · 0.76
test_ssd_save_loadFunction · 0.76
test_get_spectral_ratioFunction · 0.76