class_docstr: Preprocess one multimodal pd.DataFrame including image paths, image bytearrays, texts, numerical features,
  and categorical features. Each modality may have multiple columns.
  The preprocessor is designed to output model-agnostic features.
class_docstr_tok: ["Preprocess","one","multimodal","pd.DataFrame","including","image","paths",",","image","bytearrays",",","texts",",","numerical","features",",","and","categorical","features",".","Each","modality","may","have","multiple","columns",".","The","preprocessor","is","designed","to","output","model-agnostic","features","."]
docstr: Parameters
  ----------
  config
      Configurations regarding data preprocessing.
  column_types
      The mappings from pd.DataFrame's column names to modality types, e.g., image paths and text.
  label_column
      Name of the label column in pd.DataFrame. Can be None to support zero-short learning.
  label_generator
      A sklearn CustomLabelEncoder instance, or a customized encoder, e.g. NerPreprocessor.
code: def __init__(
      self,
      config: DictConfig,
      column_types: Dict,
      label_column: Optional[str] = None,
      label_generator: Optional[object] = None,
  ):
      """
      Parameters
      ----------
      config
          Configurations regarding data preprocessing.
      column_types
          The mappings from pd.DataFrame's column names to modality types, e.g., image paths and text.
      label_column
          Name of the label column in pd.DataFrame. Can be None to support zero-short learning.
      label_generator
          A sklearn CustomLabelEncoder instance, or a customized encoder, e.g. NerPreprocessor.
      """
      self._column_types = column_types
      self._label_column = label_column
      self._config = config
      self._feature_generators = dict()
  
      if label_column:
          if label_generator is None:
              self._label_generator = CustomLabelEncoder(
                  positive_class=OmegaConf.select(
                      config, "pos_label", default=None
                  )
              )
          else:
              self._label_generator = label_generator
  
          # Scaler used for numerical labels
          numerical_label_preprocessing = OmegaConf.select(
              config, "label.numerical_label_preprocessing"
          )
          if numerical_label_preprocessing == "minmaxscaler":
              self._label_scaler = MinMaxScaler()
          elif numerical_label_preprocessing == "standardscaler":
              self._label_scaler = StandardScaler()
          elif (
              numerical_label_preprocessing is None
              or numerical_label_preprocessing.lower() == "none"
          ):
              self._label_scaler = StandardScaler(
                  with_mean=False, with_std=False
              )
          else:
              raise ValueError(
                  f"The numerical_label_preprocessing={numerical_label_preprocessing} is currently not supported"
              )
      else:
          self._label_generator = None
          self._label_scaler = None
  
      for col_name, col_type in self._column_types.items():
          if col_name == self._label_column:
              continue
          if (
              col_type.startswith(
                  (
                      TEXT,
                      IMAGE,
                      ROIS,
                      TEXT_NER,
                      DOCUMENT,
                      SEMANTIC_SEGMENTATION,
                  )
              )
              or col_type == NULL
          ):
              continue
          elif col_type == CATEGORICAL:
              generator = CategoryFeatureGenerator(
                  cat_order="count",
                  minimum_cat_count=config.categorical.minimum_cat_count,
                  maximum_num_cat=config.categorical.maximum_num_cat,
                  verbosity=0,
              )
              self._feature_generators[col_name] = generator
          elif col_type == NUMERICAL:
              generator = Pipeline(
                  [
                      ("imputer", SimpleImputer()),
                      (
                          "scaler",
                          StandardScaler(
                              with_mean=config.numerical.scaler_with_mean,
                              with_std=config.numerical.scaler_with_std,
                          ),
                      ),
                  ]
              )
              self._feature_generators[col_name] = generator
  
          else:
              raise NotImplementedError(
                  f"Type of the column is not supported currently. Received {col_name}={col_type}."
              )
  
      self._fit_called = False
      self._fit_x_called = False
      self._fit_y_called = False
  
      # Some columns will be ignored
      self._ignore_columns_set = set()
      self._text_feature_names = []
      self._categorical_feature_names = []
      self._categorical_num_categories = []
      self._numerical_feature_names = []
      self._image_feature_names = []
      self._rois_feature_names = []
      self._ner_feature_names = []
      self._document_feature_names = []
      self._semantic_segmentation_feature_names = []
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from nptyping import NDArray
  from omegaconf import DictConfig, OmegaConf
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.impute import SimpleImputer
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import MinMaxScaler, StandardScaler
  from autogluon.features import CategoryFeatureGenerator
  from ..constants import AUTOMM, CATEGORICAL, DOCUMENT, DOCUMENT_IMAGE, IDENTIFIER, IMAGE, IMAGE_BYTEARRAY, IMAGE_PATH, LABEL, NER, NER_ANNOTATION, NULL, NUMERICAL, OVD, ROIS, SEMANTIC_SEGMENTATION, SEMANTIC_SEGMENTATION_GT, SEMANTIC_SEGMENTATION_IMG, TEXT, TEXT_NER
  from .label_encoder import CustomLabelEncoder
label_desc: Use image node_id 1 to create a new MultiModalFeaturePreprocessor object from inherited base classes: TransformerMixin, BaseEstimator with example: obj = MultiModalFeaturePreprocessor(config, column_types, label_column, label_generator)