docs: def transform(self, Y):
          """Transform input data `Y` to reduced data space defined by `self.data`
  
          Takes data in the same ambient space as `self.data` and transforms it
          to be in the same reduced space as `self.data_nu`.
  
          Parameters
          ----------
          Y : array-like, shape=[n_samples_y, n_features]
              n_features must be the same as `self.data`.
  
          Returns
          -------
          Transformed data, shape=[n_samples_y, n_pca]
  
          Raises
          ------
          ValueError : if Y.shape[1] != self.data.shape[1]
          """
          try:
              # try PCA first
  
              return self.data_pca.transform(Y)
          except AttributeError:  # no pca, try to return data
              try:
                  if Y.shape[1] != self.data.shape[1]:
                      # shape is wrong
                      raise ValueError
                  return Y
              except IndexError:
                  # len(Y.shape) < 2
                  raise ValueError
          except ValueError:
              # more informative error
              raise ValueError("data of shape {} cannot be transformed"
                               " to graph built on data of shape {}".format(
                                   Y.shape, self.data.shape))