class_docstr: Accessor to ``sklearn.cross_decomposition``.
class_docstr_tok: ["Accessor","to","``","sklearn.cross_decomposition","``","."]
code: def _transform(cls, df, estimator, *args, **kwargs):
      data = df.data.values
      if df.has_target():
          target = df.target.values
          try:
              result = estimator.transform(
                  data, Y=target, *args, **kwargs
              )
              result = df._constructor(result[0], target=result[1])
          except TypeError:
              result = estimator.transform(data, *args, **kwargs)
              result = df._constructor(result)
      else:
          # not try to pass target if it doesn't exists
          # to catch ValueError from estimator
          result = estimator.transform(data, *args, **kwargs)
          result = df._constructor(result)
      return result
  
imports: from pandas_ml.core.accessor import _AccessorMethods
label_desc: Use image node_id 2 for calling the CrossDecompositionMethods obj's underlying member method code with example usage: obj._transform(cls, df, estimator) and returns: result