class_docstr: Converts category features to one-hot boolean features by mapping to the category codes.
  
  Parameters
  ----------
  max_levels : int
      The maximum number of categories to use for OHE per feature. Selected categories are based on frequency.
  dtype : number type, default = np.uint8
      Desired dtype of output.
  sparse : bool, default = True
      Will return sparse matrix if set True else will return an array.
  drop : str, default = None
      Refer to OneHotEncoder documentation for details.
class_docstr_tok: ["Converts","category","features","to","one-hot","boolean","features","by","mapping","to","the","category","codes",".","Parameters","--","--","--","--","--","max_levels",":","int","The","maximum","number","of","categories","to","use","for","OHE","per","feature",".","Selected","categories","are","based","on","frequency",".","dtype",":","number","type",",","default","=","np.uint8","Desired","dtype","of","output",".","sparse",":","bool",",","default","=","True","Will","return","sparse","matrix","if","set","True","else","will","return","an","array",".","drop",":","str",",","default","=","None","Refer","to","OneHotEncoder","documentation","for","details","."]
code: def __init__(
      self,
      max_levels=None,
      dtype=np.uint8,
      sparse=True,
      drop=None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.max_levels = max_levels
      self.sparse = sparse
      self._ohe = OneHotEncoder(
          dtype=dtype,
          sparse=self.sparse,
          handle_unknown="ignore",
          drop=drop,
      )
      self._ohe_columns = None
      self._cat_feat_gen = None
  
imports: import logging
  import warnings
  import numpy
  import pandas
  from pandas import DataFrame
  from sklearn.preprocessing import OneHotEncoder
  from autogluon.common.features.types import R_CATEGORY, R_INT, S_BOOL, S_SPARSE
  from .abstract import AbstractFeatureGenerator
label_desc: Use image node_id 1 to create a new OneHotEncoderFeatureGenerator object from inherited base classes: AbstractFeatureGenerator with example: obj = OneHotEncoderFeatureGenerator(max_levels, dtype, sparse, drop)