class_docstr: Partial Least Squares (PLS)
  
  This class implements the generic PLS algorithm.
  
  Main ref: Wegelin, a survey of Partial Least Squares (PLS) methods,
  with emphasis on the two-block case
  https://stat.uw.edu/sites/default/files/files/reports/2000/tr371.pdf
class_docstr_tok: ["Partial","Least","Squares","(","PLS",")","This","class","implements","the","generic","PLS","algorithm",".","Main","ref",":","Wegelin",",","a","survey","of","Partial","Least","Squares","(","PLS",")","methods",",","with","emphasis","on","the","two-block","case","https",":","\/\/stat.uw.edu\/sites\/default\/files\/files\/reports\/2000\/tr371.pdf"]
docstr: Transform data back to its original space.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_components)
      New data, where `n_samples` is the number of samples
      and `n_components` is the number of pls components.
  
  Y : array-like of shape (n_samples, n_components)
      New target, where `n_samples` is the number of samples
      and `n_components` is the number of pls components.
  
  Returns
  -------
  X_reconstructed : ndarray of shape (n_samples, n_features)
      Return the reconstructed `X` data.
  
  Y_reconstructed : ndarray of shape (n_samples, n_targets)
      Return the reconstructed `X` target. Only returned when `Y` is given.
  
  Notes
  -----
  This transformation will only be exact if `n_components=n_features`.
docstr_tok: ["Transform","data","back","to","its","original","space",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_components",")","New","data",",","where","`","n_samples","`","is","the","number","of","samples","and","`","n_components","`","is","the","number","of","pls","components",".","Y",":","array-like","of","shape","(","n_samples",",","n_components",")","New","target",",","where","`","n_samples","`","is","the","number","of","samples","and","`","n_components","`","is","the","number","of","pls","components",".","Returns","--","--","--","-","X_reconstructed",":","ndarray","of","shape","(","n_samples",",","n_features",")","Return","the","reconstructed","`","X","`","data",".","Y_reconstructed",":","ndarray","of","shape","(","n_samples",",","n_targets",")","Return","the","reconstructed","`","X","`","target",".","Only","returned","when","`","Y","`","is","given",".","Notes","--","--","-","This","transformation","will","only","be","exact","if","`","n_components=n_features","`","."]
code: def inverse_transform(self, X, Y=None):
      """Transform data back to its original space.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_components)
          New data, where `n_samples` is the number of samples
          and `n_components` is the number of pls components.
  
      Y : array-like of shape (n_samples, n_components)
          New target, where `n_samples` is the number of samples
          and `n_components` is the number of pls components.
  
      Returns
      -------
      X_reconstructed : ndarray of shape (n_samples, n_features)
          Return the reconstructed `X` data.
  
      Y_reconstructed : ndarray of shape (n_samples, n_targets)
          Return the reconstructed `X` target. Only returned when `Y` is given.
  
      Notes
      -----
      This transformation will only be exact if `n_components=n_features`.
      """
      check_is_fitted(self)
      X = check_array(X, input_name="X", dtype=FLOAT_DTYPES)
      # From pls space to original space
      X_reconstructed = np.matmul(X, self.x_loadings_.T)
      # Denormalize
      X_reconstructed *= self._x_std
      X_reconstructed += self._x_mean
  
      if Y is not None:
          Y = check_array(Y, input_name="Y", dtype=FLOAT_DTYPES)
          # From pls space to original space
          Y_reconstructed = np.matmul(Y, self.y_loadings_.T)
          # Denormalize
          Y_reconstructed *= self._y_std
          Y_reconstructed += self._y_mean
          return X_reconstructed, Y_reconstructed
  
      return X_reconstructed
  
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 4 for calling the _PLS obj's underlying member method code with example usage: obj.inverse_transform(X, Y) and returns: X_reconstructed, X_reconstructed,  Y_reconstructed