code: def __init__(self, params):
      super(CatBoostAlgorithm, self).__init__(params)
      self.library_version = catboost.__version__
      self.snapshot_file_path = "training_snapshot"
  
      self.explain_level = params.get("explain_level", 0)
      self.rounds = additional.get("max_rounds", 10000)
      self.max_iters = 1
      self.early_stopping_rounds = additional.get(
          "early_stopping_rounds", 50
      )
  
      Algo = CatBoostClassifier
      loss_function = "Logloss"
      if self.params["ml_task"] == BINARY_CLASSIFICATION:
          loss_function = self.params.get("loss_function", "Logloss")
      elif self.params["ml_task"] == MULTICLASS_CLASSIFICATION:
          loss_function = self.params.get("loss_function", "MultiClass")
      elif self.params["ml_task"] == REGRESSION:
          loss_function = self.params.get("loss_function", "RMSE")
          Algo = CatBoostRegressor
  
      cat_params = {
          "iterations": self.params.get("num_boost_round", self.rounds),
          "learning_rate": self.params.get("learning_rate", 0.1),
          "depth": self.params.get("depth", 3),
          "rsm": self.params.get("rsm", 1.0),
          "l2_leaf_reg": self.params.get("l2_leaf_reg", 3.0),
          "random_strength": self.params.get("random_strength", 1.0),
          "loss_function": loss_function,
          "eval_metric": self.params.get("eval_metric", loss_function),
          # "custom_metric": self.params.get("eval_metric", loss_function),
          "thread_count": self.params.get("n_jobs", -1),
          "verbose": False,
          "allow_writing_files": False,
          "random_seed": self.params.get("seed", 1),
      }
  
      for extra_param in [
          "min_data_in_leaf",
          "bootstrap_type",
          "bagging_temperature",
          "subsample",
          "border_count",
      ]:
          if extra_param in self.params:
              cat_params[extra_param] = self.params[extra_param]
  
      self.log_metric_name = cat_params["eval_metric"]
      if cat_params["eval_metric"] == "spearman":
          cat_params["eval_metric"] = CatBoostEvalMetricSpearman()
          self.log_metric_name = "CatBoostEvalMetricSpearman"
      elif cat_params["eval_metric"] == "pearson":
          cat_params["eval_metric"] = CatBoostEvalMetricPearson()
          self.log_metric_name = "CatBoostEvalMetricPearson"
      elif cat_params["eval_metric"] == "average_precision":
          cat_params[
              "eval_metric"
          ] = CatBoostEvalMetricAveragePrecision()
          self.log_metric_name = "CatBoostEvalMetricAveragePrecision"
      elif cat_params["eval_metric"] == "mse":
          cat_params["eval_metric"] = CatBoostEvalMetricMSE()
          self.log_metric_name = "CatBoostEvalMetricMSE"
      elif cat_params["eval_metric"] == "user_defined_metric":
          cat_params["eval_metric"] = CatBoostEvalMetricUserDefined()
          self.log_metric_name = "CatBoostEvalMetricUserDefined"
  
      self.model = Algo(**cat_params)
      self.cat_features = None
      self.best_ntree_limit = 0
  
      logger.debug("CatBoostAlgorithm.__init__")
  
imports: import copy
  import logging
  import os
  import time
  import numpy
  import pandas
  from sklearn.base import ClassifierMixin, RegressorMixin
  from supervised.algorithms.algorithm import BaseAlgorithm
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION, AlgorithmsRegistry
  from supervised.preprocessing.preprocessing_utils import PreprocessingUtils
  from supervised.utils.config import LOG_LEVEL
  from supervised.utils.metric import CatBoostEvalMetricAveragePrecision, CatBoostEvalMetricMSE, CatBoostEvalMetricPearson, CatBoostEvalMetricSpearman, CatBoostEvalMetricUserDefined
  import catboost
  from catboost import CatBoost, CatBoostClassifier, CatBoostRegressor, Pool
label_desc: Use image node_id 1 to create a new CatBoostAlgorithm object from inherited base classes: BaseAlgorithm with example: obj = CatBoostAlgorithm(params)