class_docstr: Converts pandas categoricals to numpy int in preparation for OHE.
  
  Parameters
  ----------
  max_levels : int
      The maximum number of unique values for OHE. Selected categories are based on frequency.
  fillna_val : int, default = None
      The default value to fill NaN.
      If None, automatically inferred as a new value not present in existing categories.
  infrequent_val : int or {'na', 'na+1}, default = 'na'
      The value to group all infrequent categories to (those that aren't within the max_levels most frequent categories).
      If 'na', uses `fillna_val`.
      If 'na+1', uses `fillna_val+1`. This guarantees a new category for infrequent values separate from missing values if `fillna_val=None`.
class_docstr_tok: ["Converts","pandas","categoricals","to","numpy","int","in","preparation","for","OHE",".","Parameters","--","--","--","--","--","max_levels",":","int","The","maximum","number","of","unique","values","for","OHE",".","Selected","categories","are","based","on","frequency",".","fillna_val",":","int",",","default","=","None","The","default","value","to","fill","NaN",".","If","None",",","automatically","inferred","as","a","new","value","not","present","in","existing","categories",".","infrequent_val",":","int","or","{","'na","'",",","'na+1","}",",","default","=","'na'","The","value","to","group","all","infrequent","categories","to","(","those","that","are","n't","within","the","max_levels","most","frequent","categories",")",".","If","'na","'",",","uses","`","fillna_val","`",".","If","'na+1","'",",","uses","`","fillna_val+1","`",".","This","guarantees","a","new","category","for","infrequent","values","separate","from","missing","values","if","`","fillna_val=None","`","."]
code: def pd_to_np(self, X: DataFrame) -> np.ndarray:
      return X.to_numpy(
          dtype=self._dtype, na_value=self.fillna_val, copy=True
      )
  
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 4 for calling the CatToInt obj's underlying member method code with example usage: obj.pd_to_np(X) and returns: X