code: def __init__(
      self,
      loss_type,
      num_threads=None,
      log_interval=25,
      upper_model=None,
  ):
      assert (
          xgb is not None
      ), "missing requirements, please install deepspeed w. 'autotuning_ml' extra."
  
      self.loss_type = loss_type
  
      if loss_type == "reg":
          self.xgb_params = {
              "max_depth": 3,
              "gamma": 0.0001,
              "min_child_weight": 1,
              "subsample": 1.0,
              "eta": 0.3,
              "lambda": 1.0,
              "alpha": 0,
              "objective": "reg:linear",
          }
      elif loss_type == "rank":
          self.xgb_params = {
              "max_depth": 3,
              "gamma": 0.0001,
              "min_child_weight": 1,
              "subsample": 1.0,
              "eta": 0.3,
              "lambda": 1.0,
              "alpha": 0,
              "objective": "rank:pairwise",
          }
      else:
          raise RuntimeError("Invalid loss type: " + loss_type)
  
      self.xgb_params["verbosity"] = 0
      if num_threads:
          self.xgb_params["nthread"] = num_threads
  
imports: from .utils import *
label_desc: Use image node_id 1 to create a new XGBoostCostModel object  with example: obj = XGBoostCostModel(loss_type, num_threads, log_interval, upper_model)