class_docstr: An nvcategory based implementation of ordinal label encoding
  
  Parameters
  ----------
  handle_unknown : {'error', 'ignore'}, default='error'
      Whether to raise an error or ignore if an unknown categorical feature
      is present during transform (default is to raise). When this parameter
      is set to 'ignore' and an unknown category is encountered during
      transform or inverse transform, the resulting encoding will be null.
  handle : cuml.Handle
      Specifies the cuml.handle that holds internal CUDA state for
      computations in this model. Most importantly, this specifies the CUDA
      stream that will be used for the model's computations, so users can
      run different models concurrently in different streams by creating
      handles in several streams.
      If it is None, a new one is created.
  verbose : int or boolean, default=False
      Sets logging level. It must be one of `cuml.common.logger.level_*`.
      See :ref:`verbosity-levels` for more info.
  output_type : {'input', 'array', 'dataframe', 'series', 'df_obj',         'numba', 'cupy', 'numpy', 'cudf', 'pandas'}, default=None
      Return results and set estimator attributes to the indicated output
      type. If None, the output type set at the module level
      (`cuml.global_settings.output_type`) will be used. See
      :ref:`output-data-type-configuration` for more info.
  
  Examples
  --------
  
  Converting a categorical implementation to a numerical one
  
  >>> from cudf import DataFrame, Series
  >>> from cuml.preprocessing import LabelEncoder
  >>> data = DataFrame({'category': ['a', 'b', 'c', 'd']})
  
  >>> # There are two functionally equivalent ways to do this
  >>> le = LabelEncoder()
  >>> le.fit(data.category)  # le = le.fit(data.category) also works
  LabelEncoder()
  >>> encoded = le.transform(data.category)
  
  >>> print(encoded)
  0    0
  1    1
  2    2
  3    3
  dtype: uint8
  
  >>> # This method is preferred
  >>> le = LabelEncoder()
  >>> encoded = le.fit_transform(data.category)
  
  >>> print(encoded)
  0    0
  1    1
  2    2
  3    3
  dtype: uint8
  
  >>> # We can assign this to a new column
  >>> data = data.assign(encoded=encoded)
  >>> print(data.head())
  category  encoded
  0         a        0
  1         b        1
  2         c        2
  3         d        3
  
  >>> # We can also encode more data
  >>> test_data = Series(['c', 'a'])
  >>> encoded = le.transform(test_data)
  >>> print(encoded)
  0    2
  1    0
  dtype: uint8
  
  >>> # After train, ordinal label can be inverse_transform() back to
  >>> # string labels
  >>> ord_label = cudf.Series([0, 0, 1, 2, 1])
  >>> str_label = le.inverse_transform(ord_label)
  >>> print(str_label)
  0    a
  1    a
  2    b
  3    c
  4    b
  dtype: object
docstr: Simultaneously fit and transform an input
  
  This is functionally equivalent to (but faster than)
  `LabelEncoder().fit(y).transform(y)`
docstr_tok: ["Simultaneously","fit","and","transform","an","input","This","is","functionally","equivalent","to","(","but","faster","than",")","`","LabelEncoder","(",")",".fit","(","y",")",".transform","(","y",")","`"]
code: def fit_transform(self, y, z=None) -> cudf.Series:
      """
      Simultaneously fit and transform an input
  
      This is functionally equivalent to (but faster than)
      `LabelEncoder().fit(y).transform(y)`
      """
  
      y = self._to_cudf_series(y)
      self.dtype = y.dtype if y.dtype != cp.dtype("O") else str
  
      y = y.astype("category")
      self.classes_ = y._column.categories
  
      self._fitted = True
      return cudf.Series(y._column.codes, index=y.index)
  
file_path: cuml/python/cuml/preprocessing/LabelEncoder.py
imports: from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import cpu_only_import_from
  from cuml import Base
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 6 for calling the LabelEncoder obj's underlying member method code with example usage: obj.fit_transform(y, z) and returns: cudf