class_docstr: A cudf based implementation of target encoding [1]_, which converts
  one or multiple categorical variables, 'Xs', with the average of
  corresponding values of the target variable, 'Y'. The input data is
  grouped by the columns `Xs` and the aggregated mean value of `Y` of
  each group is calculated to replace each value of `Xs`. Several
  optimizations are applied to prevent label leakage and parallelize
  the execution.
  
  Parameters
  ----------
  n_folds : int (default=4)
      Default number of folds for fitting training data. To prevent
      label leakage in `fit`, we split data into `n_folds` and
      encode one fold using the target variables of the remaining folds.
  smooth : int or float (default=0)
      Count of samples to smooth the encoding. 0 means no smoothing.
  seed : int (default=42)
      Random seed
  split_method : {'random', 'continuous', 'interleaved'},         (default='interleaved')
      Method to split train data into `n_folds`.
      'random': random split.
      'continuous': consecutive samples are grouped into one folds.
      'interleaved': samples are assign to each fold in a round robin way.
      'customize': customize splitting by providing a `fold_ids` array
      in `fit()` or `fit_transform()` functions.
  output_type : {'cupy', 'numpy', 'auto'}, default = 'auto'
      The data type of output. If 'auto', it matches input data.
  stat : {'mean','var','median'}, default = 'mean'
      The statistic used in encoding, mean, variance or median of the
      target.
  
  References
  ----------
  .. [1] https://maxhalford.github.io/blog/target-encoding/
  
  Examples
  --------
  Converting a categorical implementation to a numerical one
  
  >>> from cudf import DataFrame, Series
  >>> from cuml.preprocessing import TargetEncoder
  >>> train = DataFrame({'category': ['a', 'b', 'b', 'a'],
  ...                    'label': [1, 0, 1, 1]})
  >>> test = DataFrame({'category': ['a', 'c', 'b', 'a']})
  
  >>> encoder = TargetEncoder()
  >>> train_encoded = encoder.fit_transform(train.category, train.label)
  >>> test_encoded = encoder.transform(test.category)
  >>> print(train_encoded)
  [1. 1. 0. 1.]
  >>> print(test_encoded)
  [1.   0.75 0.5  1.  ]
docstr: Return True if the dataframe `df` is the training dataframe, which
  is used in `fit_transform`
docstr_tok: ["Return","True","if","the","dataframe","`","df","`","is","the","training","dataframe",",","which","is","used","in","`","fit_transform","`"]
code: def _is_train_df(self, df):
      """
      Return True if the dataframe `df` is the training dataframe, which
      is used in `fit_transform`
      """
      if len(df) != len(self.train):
          return False
      self.train = self.train.sort_values(self.id_col).reset_index(
          drop=True
      )
      for col in df.columns:
          if col not in self.train.columns:
              raise ValueError(
                  f"Input column {col} " "is not in train data."
              )
          if not (df[col] == self.train[col]).all():
              return False
      return True
  
imports: import warnings
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 12 for calling the TargetEncoder obj's underlying member method code with example usage: obj._is_train_df(df) and returns: True, False, False