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

Method fit

mne/decoding/ssd.py:243–271  ·  view source on GitHub ↗

Estimate the SSD decomposition on raw or epoched data. 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 epoc

(self, X, y=None)

Source from the content-addressed store, hash-verified

241 return X
242
243 def fit(self, X, y=None):
244 """Estimate the SSD decomposition on raw or epoched data.
245
246 Parameters
247 ----------
248 X : array, shape ([n_epochs, ]n_channels, n_times)
249 The input data from which to estimate the SSD. Either 2D array
250 obtained from continuous data or 3D array obtained from epoched
251 data.
252 y : None
253 Ignored; exists for compatibility with scikit-learn pipelines.
254
255 Returns
256 -------
257 self : instance of SSD
258 Returns the modified instance.
259 """
260 X = self._check_X(X, y=y, fit=True)
261 self._validate_params(X)
262 if isinstance(self.info, Info):
263 info = self.info
264 else:
265 info = create_info(X.shape[-2], self.sfreq_, ch_types="eeg")
266 self.picks_ = _picks_to_idx(info, self.picks, none="data", exclude="bads")
267
268 super().fit(X, y)
269
270 logger.info("Done.")
271 return self
272
273 def transform(self, X):
274 """Estimate epochs sources given the SSD filters.

Callers 8

test_ssdFunction · 0.95
test_ssd_epoched_dataFunction · 0.95
test_sortingFunction · 0.95
test_return_filteredFunction · 0.95
test_non_full_rank_dataFunction · 0.95
test_picks_argFunction · 0.95
test_ssd_save_loadFunction · 0.95
test_get_spectral_ratioFunction · 0.95

Calls 5

_check_XMethod · 0.95
_validate_paramsMethod · 0.95
create_infoFunction · 0.85
_picks_to_idxFunction · 0.85
infoMethod · 0.80

Tested by 8

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