code: def init_df_preprocessor(
      config: DictConfig,
      column_types: Dict,
      label_column: Optional[str] = None,
      train_df_x: Optional[pd.DataFrame] = None,
      train_df_y: Optional[pd.Series] = None,
  ):
      """
      Initialize the dataframe preprocessor by calling .fit().
  
      Parameters
      ----------
      config
          A DictConfig containing only the data config.
      column_types
          A dictionary that maps column names to their data types.
          For example: `column_types = {"item_name": "text", "image": "image_path",
          "product_description": "text", "height": "numerical"}`
          may be used for a table with columns: "item_name", "brand", "product_description", and "height".
      label_column
          Name of the column that contains the target variable to predict.
      train_df_x
          A pd.DataFrame containing only the feature columns.
      train_df_y
          A pd.Series object containing only the label column.
  
      Returns
      -------
      Initialized dataframe preprocessor.
      """
      if (
          label_column in column_types
          and column_types[label_column] == NER_ANNOTATION
      ):
          label_generator = NerLabelEncoder(config)
      else:
          label_generator = None
  
      df_preprocessor = MultiModalFeaturePreprocessor(
          config=config.data,
          column_types=column_types,
          label_column=label_column,
          label_generator=label_generator,
      )
      df_preprocessor.fit(
          X=train_df_x,
          y=train_df_y,
      )
  
      return df_preprocessor
  
imports: import copy
  import logging
  import os
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import pandas
  from omegaconf import DictConfig, OmegaConf
  from torch import nn
  from autogluon.core.utils import default_holdout_frac, generate_train_test_split_combined
  from autogluon.core.utils.loaders import load_pd
  from ..constants import BINARY, CATEGORICAL, DEFAULT_SHOT, DOCUMENT, FEW_SHOT, IMAGE, IMAGE_PATH, LABEL, MMLAB_MODELS, MULTICLASS, NER, NER_ANNOTATION, NER_TEXT, NUMERICAL, OVD, REGRESSION, ROIS, SAM, SEMANTIC_SEGMENTATION_IMG, TEXT, TEXT_NER
  from ..data import CategoricalProcessor, DocumentProcessor, ImageProcessor, LabelProcessor, MixupModule, MMDetProcessor, MMOcrProcessor, MultiModalFeaturePreprocessor, NerLabelEncoder, NerProcessor, NumericalProcessor, OVDProcessor, SemanticSegImageProcessor, TextProcessor
  from ..data.infer_types import is_image_column
label_desc: Use image node_id 1 for calling a global function with example usage: init_df_preprocessor(config, column_types, label_column, train_df_x, train_df_y) and returns: df_preprocessor