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

Method fit

mne/decoding/transformer.py:314–334  ·  view source on GitHub ↗

Store the shape of the features of X. 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 samples

(self, X, y=None)

Source from the content-addressed store, hash-verified

312 """
313
314 def fit(self, X, y=None):
315 """Store the shape of the features of X.
316
317 Parameters
318 ----------
319 X : array-like
320 The data to fit. Can be, for example a list, or an array of at
321 least 2d. The first dimension must be of length n_samples, where
322 samples are the independent samples used by the estimator
323 (e.g. n_epochs for epoched data).
324 y : None | array, shape (n_samples,)
325 Used for scikit-learn compatibility.
326
327 Returns
328 -------
329 self : instance of Vectorizer
330 Return the modified instance.
331 """
332 X = self._check_data(X, y=y, atleast_3d=False, fit=True, check_n_features=False)
333 self.features_shape_ = X.shape[1:]
334 return self
335
336 def transform(self, X):
337 """Convert given array into two dimensions.

Callers 2

fit_transformMethod · 0.95
test_vectorizerFunction · 0.95

Calls 1

_check_dataMethod · 0.45

Tested by 1

test_vectorizerFunction · 0.76