code: def _fit_categorical_convert(self, X):
      for column in self._columns:
          if (
              PreprocessingUtils.get_type(X[column])
              != PreprocessingUtils.CATEGORICAL
          ):
              # no need to convert, already a number
              continue
          # limit categories - it is needed when doing one hot encoding
          # this code is also used in predict.py file
          # and transform_utils.py
          # TODO it needs refactoring !!!
          too_much_categories = (
              len(np.unique(list(X[column].values))) > 200
          )
          lbl = None
          if (
              self._convert_method
              == PreprocessingCategorical.CONVERT_ONE_HOT
              and not too_much_categories
          ):
              lbl = LabelBinarizer()
              lbl.fit(X, column)
          else:
              lbl = LabelEncoder()
              lbl.fit(X[column])
  
          if lbl is not None:
              self._convert_params[column] = lbl.to_json()
  
file_path: mljar-supervised/supervised/preprocessing/preprocessing_categorical.py
imports: import json
  import os
  import numpy
  import pandas
  from supervised.preprocessing.label_binarizer import LabelBinarizer
  from supervised.preprocessing.label_encoder import LabelEncoder
  from supervised.preprocessing.loo_encoder import LooEncoder
  from supervised.preprocessing.preprocessing_utils import PreprocessingUtils
label_desc: Use image node_id 3 for calling the PreprocessingCategorical obj's underlying member method code with example usage: obj._fit_categorical_convert(X) without return types