MCPcopy Index your code
hub / github.com/mne-tools/mne-python / fit_transform

Method fit_transform

mne/decoding/transformer.py:357–375  ·  view source on GitHub ↗

Fit the data, then transform in one step. Parameters ---------- X : array-like The data to fit. Can be, for example a list, or an array of at least 2d. The first dimension must be of length n_samples, where samples are the independent samp

(self, X, y=None)

Source from the content-addressed store, hash-verified

355 return X.reshape(len(X), -1)
356
357 def fit_transform(self, X, y=None):
358 """Fit the data, then transform in one step.
359
360 Parameters
361 ----------
362 X : array-like
363 The data to fit. Can be, for example a list, or an array of at
364 least 2d. The first dimension must be of length n_samples, where
365 samples are the independent samples used by the estimator
366 (e.g. n_epochs for epoched data).
367 y : None | array, shape (n_samples,)
368 Used for scikit-learn compatibility.
369
370 Returns
371 -------
372 X : array, shape (n_samples, -1)
373 The transformed data.
374 """
375 return self.fit(X).transform(X)
376
377 def inverse_transform(self, X):
378 """Transform 2D data back to its original feature shape.

Callers 1

test_vectorizerFunction · 0.95

Calls 2

fitMethod · 0.95
transformMethod · 0.45

Tested by 1

test_vectorizerFunction · 0.76