code: def transform(self, X):
      if (
          self._convert_method == PreprocessingCategorical.CONVERT_LOO
          and self._columns
      ):
          return self._enc.transform(X)
      else:
          for column, lbl_params in self._convert_params.items():
              if (
                  "unique_values" in lbl_params
                  and "new_columns" in lbl_params
              ):
                  # convert to one hot
                  lbl = LabelBinarizer()
                  lbl.from_json(lbl_params)
                  X = lbl.transform(X, column)
              else:
                  # convert to integer
                  lbl = LabelEncoder()
                  lbl.from_json(lbl_params)
                  X.loc[:, column] = lbl.transform(X.loc[:, column])
  
          return X
  
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 4 for calling the PreprocessingCategorical obj's underlying member method code with example usage: obj.transform(X) and returns: self, X