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)
| 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. |