docstr: Encode categorical features as an integer array.
  
  The input to this transformer should be an :py:class:`cudf.DataFrame` or a
  :py:class:`cupy.ndarray`, denoting the unique values taken on by categorical
  (discrete) features. The features are converted to ordinal integers. This
  results in a single column of integers (0 to n_categories - 1) per feature.
  
  Parameters
  ----------
  categories : 'auto' an cupy.ndarray or a cudf.DataFrame, default='auto'
               Categories (unique values) per feature:
      - 'auto' : Determine categories automatically from the training data.
      - DataFrame/ndarray : ``categories[col]`` holds the categories expected
        in the feature col.
  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, the
      resulting encoded value would be null when output type is cudf
      dataframe.
  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.
code: def __init__(
      self,
      *,
      categories="auto",
      dtype=np.float64,
      handle_unknown="error",
      handle=None,
      verbose=False,
      output_type=None,
  ) -> None:
      """Encode categorical features as an integer array.
  
          The input to this transformer should be an :py:class:`cudf.DataFrame` or a
          :py:class:`cupy.ndarray`, denoting the unique values taken on by categorical
          (discrete) features. The features are converted to ordinal integers. This
          results in a single column of integers (0 to n_categories - 1) per feature.
  
          Parameters
          ----------
          categories : 'auto' an cupy.ndarray or a cudf.DataFrame, default='auto'
                       Categories (unique values) per feature:
              - 'auto' : Determine categories automatically from the training data.
              - DataFrame/ndarray : ``categories[col]`` holds the categories expected
                in the feature col.
          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, the
              resulting encoded value would be null when output type is cudf
              dataframe.
          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.
          """
      super().__init__(
          handle=handle, verbose=verbose, output_type=output_type
      )
  
      self.categories = categories
      self.dtype = dtype
      self.handle_unknown = handle_unknown
  
      self.input_type = None
  
imports: import warnings
  from typing import List, Optional, TypeVar
  import cuml.internals.logger
  from cudf import DataFrame, Series
  from cuml import Base
  from cuml.common.doc_utils import generate_docstring
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import cpu_only_import, gpu_only_import, gpu_only_import_from
  from cuml.preprocessing import LabelEncoder
label_desc: Use image node_id 1 to create a new OrdinalEncoder object from inherited base classes: BaseEncoder with example: obj = OrdinalEncoder()