docstr: Fit model to X and perform dimensionality reduction on X.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Training data.
  
  y : Ignored
  
  Returns
  -------
  X_new : array, shape (n_samples, n_components)
      Reduced version of X. This will always be a dense array, of the
      same type as the input array. If ``X`` was a ``dask.array``, then
      ``X_new`` will be a ``dask.array`` with the same chunks along the
      first dimension.
docstr_tok: ["Fit","model","to","X","and","perform","dimensionality","reduction","on","X.","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","Training","data",".","y",":","Ignored","Returns","--","--","--","-","X_new",":","array",",","shape","(","n_samples",",","n_components",")","Reduced","version","of","X",".","This","will","always","be","a","dense","array",",","of","the","same","type","as","the","input","array",".","If","``","X","``","was","a","``","dask.array","``",",","then","``","X_new","``","will","be","a","``","dask.array","``","with","the","same","chunks","along","the","first","dimension","."]
code: def fit_transform(self, X, y=None):
      """Fit model to X and perform dimensionality reduction on X.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Training data.
  
      y : Ignored
  
      Returns
      -------
      X_new : array, shape (n_samples, n_components)
          Reduced version of X. This will always be a dense array, of the
          same type as the input array. If ``X`` was a ``dask.array``, then
          ``X_new`` will be a ``dask.array`` with the same chunks along the
          first dimension.
      """
      X = self._check_array(X)
      if self.algorithm not in {"tsqr", "randomized"}:
          raise ValueError(
              "`algorithm` must be 'tsqr' or 'randomized', not '{}'".format(
                  self.algorithm
              )
          )
      if self.algorithm == "tsqr":
          u, s, v = da.linalg.svd(X)
          u = u[:, : self.n_components]
          s = s[: self.n_components]
          v = v[: self.n_components]
      else:
          u, s, v = da.linalg.svd_compressed(
              X,
              self.n_components,
              n_power_iter=self.n_iter,
              seed=self.random_state,
          )
      if not DASK_2_26_0:
          u, v = svd_flip(u, v)
  
      X_transformed = u * s
      explained_var = X_transformed.var(axis=0)
      full_var = X.var(axis=0).sum()
      explained_variance_ratio = explained_var / full_var
  
      if self.compute:
          v, explained_var, explained_variance_ratio, s = compute(
              v, explained_var, explained_variance_ratio, s
          )
      self.components_ = v
      self.explained_variance_ = explained_var
      self.explained_variance_ratio_ = explained_variance_ratio
      self.singular_values_ = s
      self.n_features_in_ = X.shape[1]
      return X_transformed
  
file_path: dask-ml/dask_ml/decomposition/truncated_svd.py
imports: import dask.array
  from dask import compute
  from sklearn.base import BaseEstimator, TransformerMixin
  from .._compat import DASK_2_26_0
  from ..utils import svd_flip
label_desc: Use image node_id 4 for calling the TruncatedSVD obj's underlying member method code with example usage: obj.fit_transform(X, y) and returns: X_transformed