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: Transform an input into its categorical keys.
  
  This is intended for test data. For fitting and transforming
  the training data, prefer `fit_transform`.
  
  Parameters
  ----------
  x : cudf.Series
      Input keys to be transformed. Its values doesn't have to
      match the categories given to `fit`
  
  Returns
  -------
  encoded : cupy.ndarray
      The ordinally encoded input series
docstr_tok: ["Transform","an","input","into","its","categorical","keys",".","This","is","intended","for","test","data",".","For","fitting","and","transforming","the","training","data",",","prefer","`","fit_transform","`",".","Parameters","--","--","--","--","--","x",":","cudf.Series","Input","keys","to","be","transformed",".","Its","values","does","n't","have","to","match","the","categories","given","to","`","fit","`","Returns","--","--","--","-","encoded",":","cupy.ndarray","The","ordinally","encoded","input","series"]
code: def transform(self, x):
      """
      Transform an input into its categorical keys.
  
      This is intended for test data. For fitting and transforming
      the training data, prefer `fit_transform`.
  
      Parameters
      ----------
      x : cudf.Series
          Input keys to be transformed. Its values doesn't have to
          match the categories given to `fit`
  
      Returns
      -------
      encoded : cupy.ndarray
          The ordinally encoded input series
  
      """
      self._check_is_fitted()
      test = self._data_with_strings_to_cudf_dataframe(x)
      if self._is_train_df(test):
          return self.train_encode
      x_cols = [i for i in test.columns.tolist() if i != self.id_col]
      test = test.merge(self.encode_all, on=x_cols, how="left")
      return self._impute_and_sort(test)
  
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 4 for calling the TargetEncoder obj's underlying member method code with example usage: obj.transform(x) and returns: self, self