(self, X, y=None, **fit_params)
Fit to data, then transform it.

        Fits transformer to `X` and `y` with optional parameters `fit_params`
        and returns a transformed version of `X`.

        Parameters
        ----------
        X : ndarray of shape (n_samples, ...)
            Input data.

        y : None
            There is no need for a target, yet the pipeline API requires this
            parameter.

        Returns
        -------
        Xt : numpy array of shape (n_samples, ...)
            Transformed input.
Fit to data, then transform it.
Fit to data then transform it .
def fit_transform(self, X, y=None, **fit_params):
        """Fit to data, then transform it.

        Fits transformer to `X` and `y` with optional parameters `fit_params`
        and returns a transformed version of `X`.

        Parameters
        ----------
        X : ndarray of shape (n_samples, ...)
            Input data.

        y : None
            There is no need for a target, yet the pipeline API requires this
            parameter.

        Returns
        -------
        Xt : numpy array of shape (n_samples, ...)
            Transformed input.

        """
        # non-optimized default implementation; override when a better
        # method is possible for a given clustering algorithm
        if y is None:
            # fit method of arity 1 (unsupervised transformation)
            return self.fit(X, **fit_params).transform(X)
        else:
            # fit method of arity 2 (supervised transformation)
            return self.fit(X, y, **fit_params).transform(X, y)
def fit_transform ( self , X , y = None , * * fit_params ) : # non-optimized default implementation; override when a better # method is possible for a given clustering algorithm if y is None : # fit method of arity 1 (unsupervised transformation) return self . fit ( X , * * fit_params ) . transform ( X ) else : # fit method of arity 2 (supervised transformation) return self . fit ( X , y , * * fit_params ) . transform ( X , y )