MCPcopy Create free account
hub / github.com/scikit-learn/scikit-learn / fit_transform

Method fit_transform

sklearn/preprocessing/_data.py:3390–3407  ·  view source on GitHub ↗

Fit `PowerTransformer` to `X`, then transform `X`. Parameters ---------- X : array-like of shape (n_samples, n_features) The data used to estimate the optimal transformation parameters and to be transformed using a power transformation. y : I

(self, X, y=None)

Source from the content-addressed store, hash-verified

3388
3389 @_fit_context(prefer_skip_nested_validation=True)
3390 def fit_transform(self, X, y=None):
3391 """Fit `PowerTransformer` to `X`, then transform `X`.
3392
3393 Parameters
3394 ----------
3395 X : array-like of shape (n_samples, n_features)
3396 The data used to estimate the optimal transformation parameters
3397 and to be transformed using a power transformation.
3398
3399 y : Ignored
3400 Not used, present for API consistency by convention.
3401
3402 Returns
3403 -------
3404 X_new : ndarray of shape (n_samples, n_features)
3405 Transformed data.
3406 """
3407 return self._fit(X, y, force_transform=True)
3408
3409 def _fit(self, X, y=None, force_transform=False):
3410 X = self._check_input(X, in_fit=True, check_positive=True)

Calls 1

_fitMethod · 0.95