code: def get_categorical_strategy(
      self, current_models, strategy, total_time_limit
  ):
      model_selection_time_limit = (
          None if total_time_limit is None else 0.1 * total_time_limit
      )
      df_models, algorithms = self.df_models_algorithms(
          current_models, time_limit=model_selection_time_limit
      )
      generated_params = []
      for m_type in algorithms:
          # try to add categorical strategy only for below algorithms
          if m_type not in [
              "Xgboost",
              # "LightGBM", # use built-in categoricals (but need to int encode)
              # "Neural Network",
              # "Random Forest",
              # "Extra Trees",
          ]:
              continue
          models = df_models[df_models.model_type == m_type]["model"]
  
          for i in range(min(1, len(models))):
              m = models.iloc[i]
  
              params = copy.deepcopy(m.params)
              cols_preprocessing = params["preprocessing"][
                  "columns_preprocessing"
              ]
  
              for col, preproc in params["preprocessing"][
                  "columns_preprocessing"
              ].items():
                  new_preproc = []
                  convert_categorical = False
  
                  for p in preproc:
                      if "categorical" not in p:
                          new_preproc += [p]
                      else:
                          convert_categorical = True
  
                  col_data_info = self._data_info["columns_info"].get(
                      col
                  )
                  few_categories = False
                  if (
                      col_data_info is not None
                      and "few_categories" in col_data_info
                  ):
                      few_categories = True
  
                  if convert_categorical:
                      if (
                          strategy
                          == PreprocessingTuner.CATEGORICALS_ALL_INT
                      ):
                          new_preproc += [
                              PreprocessingCategorical.CONVERT_INTEGER
                          ]
                      elif (
                          strategy
                          == PreprocessingTuner.CATEGORICALS_LOO
                      ):
                          new_preproc += [
                              PreprocessingCategorical.CONVERT_LOO
                          ]
                      elif (
                          strategy
                          == PreprocessingTuner.CATEGORICALS_MIX
                      ):
                          if few_categories:
                              new_preproc += [
                                  PreprocessingCategorical.CONVERT_ONE_HOT
                              ]
                          else:
                              new_preproc += [
                                  PreprocessingCategorical.CONVERT_INTEGER
                              ]
  
                  cols_preprocessing[col] = new_preproc
  
              params["preprocessing"][
                  "columns_preprocessing"
              ] = cols_preprocessing
              # if there is already a name of categorical strategy in the name
              # please remove it to avoid confusion (I hope!)
              for st in [
                  PreprocessingTuner.CATEGORICALS_LOO,
                  PreprocessingTuner.CATEGORICALS_ALL_INT,
                  PreprocessingTuner.CATEGORICALS_MIX,
              ]:
                  params["name"] = params["name"].replace("_" + st, "")
              params["name"] += f"_{strategy}"
              params["status"] = "initialized"
              params["final_loss"] = None
              params["train_time"] = None
              params["data_type"] = (
                  params.get("data_type", "") + "_" + strategy
              )
              if self._optuna_time_budget is not None:
                  params[
                      "optuna_time_budget"
                  ] = self._optuna_time_budget
                  params[
                      "optuna_init_params"
                  ] = self._optuna_init_params
                  params["optuna_verbose"] = self._optuna_verbose
  
              if "model_architecture_json" in params["learner"]:
                  del params["learner"]["model_architecture_json"]
              unique_params_key = MljarTuner.get_params_key(params)
              if unique_params_key not in self._unique_params_keys:
                  generated_params += [params]
      return generated_params
  
imports: import copy
  import json
  import logging
  import os
  import numpy
  import pandas
  from sklearn.preprocessing import OneHotEncoder
  from supervised.algorithms.catboost import catboost_eval_metric
  from supervised.algorithms.lightgbm import lightgbm_eval_metric
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION, AlgorithmsRegistry
  from supervised.algorithms.xgboost import xgboost_eval_metric
  from supervised.preprocessing.label_encoder import LabelEncoder
  from supervised.preprocessing.preprocessing_categorical import PreprocessingCategorical
  from supervised.tuner.hill_climbing import HillClimbing
  from supervised.tuner.preprocessing_tuner import PreprocessingTuner
  from supervised.tuner.random_parameters import RandomParameters
  from supervised.utils.config import LOG_LEVEL
  from supervised.utils.utils import dump_data, load_data
label_desc: Use image node_id 24 for calling the MljarTuner obj's underlying member method code with example usage: obj.get_categorical_strategy(current_models, strategy, total_time_limit) and returns: generated_params