class_docstr: Partial Least Square SVD.
  
  This transformer simply performs a SVD on the cross-covariance matrix
  `X'Y`. It is able to project both the training data `X` and the targets
  `Y`. The training data `X` is projected on the left singular vectors, while
  the targets are projected on the right singular vectors.
  
  Read more in the :ref:`User Guide <cross_decomposition>`.
  
  .. versionadded:: 0.8
  
  Parameters
  ----------
  n_components : int, default=2
      The number of components to keep. Should be in `[1,
      min(n_samples, n_features, n_targets)]`.
  
  scale : bool, default=True
      Whether to scale `X` and `Y`.
  
  copy : bool, default=True
      Whether to copy `X` and `Y` in fit before applying centering, and
      potentially scaling. If `False`, these operations will be done inplace,
      modifying both arrays.
  
  Attributes
  ----------
  x_weights_ : ndarray of shape (n_features, n_components)
      The left singular vectors of the SVD of the cross-covariance matrix.
      Used to project `X` in :meth:`transform`.
  
  y_weights_ : ndarray of (n_targets, n_components)
      The right singular vectors of the SVD of the cross-covariance matrix.
      Used to project `X` in :meth:`transform`.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  PLSCanonical : Partial Least Squares transformer and regressor.
  CCA : Canonical Correlation Analysis.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.cross_decomposition import PLSSVD
  >>> X = np.array([[0., 0., 1.],
  ...               [1., 0., 0.],
  ...               [2., 2., 2.],
  ...               [2., 5., 4.]])
  >>> Y = np.array([[0.1, -0.2],
  ...               [0.9, 1.1],
  ...               [6.2, 5.9],
  ...               [11.9, 12.3]])
  >>> pls = PLSSVD(n_components=2).fit(X, Y)
  >>> X_c, Y_c = pls.transform(X, Y)
  >>> X_c.shape, Y_c.shape
  ((4, 2), (4, 2))
class_docstr_tok: ["Partial","Least","Square","SVD",".","This","transformer","simply","performs","a","SVD","on","the","cross-covariance","matrix","`","X","'","Y","`",".","It","is","able","to","project","both","the","training","data","`","X","`","and","the","targets","`","Y","`",".","The","training","data","`","X","`","is","projected","on","the","left","singular","vectors",",","while","the","targets","are","projected","on","the","right","singular","vectors",".","Read","more","in","the",":","ref",":","`","User","Guide","<","cross_decomposition",">","`",".","..","versionadded",":",":","0.8","Parameters","--","--","--","--","--","n_components",":","int",",","default=2","The","number","of","components","to","keep",".","Should","be","in","`","[","1",",","min","(","n_samples",",","n_features",",","n_targets",")","]","`",".","scale",":","bool",",","default=True","Whether","to","scale","`","X","`","and","`","Y","`",".","copy",":","bool",",","default=True","Whether","to","copy","`","X","`","and","`","Y","`","in","fit","before","applying","centering",",","and","potentially","scaling",".","If","`","False","`",",","these","operations","will","be","done","inplace",",","modifying","both","arrays",".","Attributes","--","--","--","--","--","x_weights_",":","ndarray","of","shape","(","n_features",",","n_components",")","The","left","singular","vectors","of","the","SVD","of","the","cross-covariance","matrix",".","Used","to","project","`","X","`","in",":","meth",":","`","transform","`",".","y_weights_",":","ndarray","of","(","n_targets",",","n_components",")","The","right","singular","vectors","of","the","SVD","of","the","cross-covariance","matrix",".","Used","to","project","`","X","`","in",":","meth",":","`","transform","`",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","PLSCanonical",":","Partial","Least","Squares","transformer","and","regressor",".","CCA",":","Canonical","Correlation","Analysis",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.cross_decomposition","import","PLSSVD",">",">",">","X","=","np.array","(","[","[","0.",",","0.",",","1",".","]",",","...","[","1.",",","0.",",","0",".","]",",","...","[","2.",",","2.",",","2",".","]",",","...","[","2.",",","5.",",","4",".","]","]",")",">",">",">","Y","=","np.array","(","[","[","0.1",",","-0.2","]",",","...","[","0.9",",","1.1","]",",","...","[","6.2",",","5.9","]",",","...","[","11.9",",","12.3","]","]",")",">",">",">","pls","=","PLSSVD","(","n_components=2",")",".fit","(","X",",","Y",")",">",">",">","X_c",",","Y_c","=","pls.transform","(","X",",","Y",")",">",">",">","X_c.shape",",","Y_c.shape","(","(","4",",","2",")",",","(","4",",","2",")",")"]
docstr: Apply the dimensionality reduction.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Samples to be transformed.
  
  Y : array-like of shape (n_samples,) or (n_samples, n_targets),                 default=None
      Targets.
  
  Returns
  -------
  x_scores : array-like or tuple of array-like
      The transformed data `X_transformed` if `Y is not None`,
      `(X_transformed, Y_transformed)` otherwise.
docstr_tok: ["Apply","the","dimensionality","reduction",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Samples","to","be","transformed",".","Y",":","array-like","of","shape","(","n_samples",",",")","or","(","n_samples",",","n_targets",")",",","default=None","Targets",".","Returns","--","--","--","-","x_scores",":","array-like","or","tuple","of","array-like","The","transformed","data","`","X_transformed","`","if","`","Y","is","not","None","`",",","`","(","X_transformed",",","Y_transformed",")","`","otherwise","."]
code: def transform(self, X, Y=None):
      """
          Apply the dimensionality reduction.
  
          Parameters
          ----------
          X : array-like of shape (n_samples, n_features)
              Samples to be transformed.
  
          Y : array-like of shape (n_samples,) or (n_samples, n_targets), \
                  default=None
              Targets.
  
          Returns
          -------
          x_scores : array-like or tuple of array-like
              The transformed data `X_transformed` if `Y is not None`,
              `(X_transformed, Y_transformed)` otherwise.
          """
      check_is_fitted(self)
      X = self._validate_data(X, dtype=np.float64, reset=False)
      Xr = (X - self._x_mean) / self._x_std
      x_scores = np.dot(Xr, self.x_weights_)
      if Y is not None:
          Y = check_array(
              Y, input_name="Y", ensure_2d=False, dtype=np.float64
          )
          if Y.ndim == 1:
              Y = Y.reshape(-1, 1)
          Yr = (Y - self._y_mean) / self._y_std
          y_scores = np.dot(Yr, self.y_weights_)
          return x_scores, y_scores
      return x_scores
  
imports: import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral, Real
  import numpy
  from scipy.linalg import svd
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, MultiOutputMixin, RegressorMixin, TransformerMixin, _fit_context
  from ..exceptions import ConvergenceWarning
  from ..utils import check_array, check_consistent_length
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.extmath import svd_flip
  from ..utils.fixes import parse_version, sp_version
  from ..utils.validation import FLOAT_DTYPES, check_is_fitted
label_desc: Use image node_id 3 for calling the PLSSVD obj's underlying member method code with example usage: obj.transform(X, Y) and returns: x_scores, x_scores,  y_scores