code: def __init__(self, params=None, compile=False, cache=None):
      # we start boosting from zero
      self.num_boosted_rounds = 0
  
      # default parameter
      # xgboost provides other options for it but the way to modify it remains
      # undocumented for Python API
      self.updater = coordinate_updater
  
      # LogisticRegression corresponds to 'binary:logistic' objective in terms of
      # calculations
      # In xgboost LogisticClassification is used, but it simply subclasses
      # LogisticRegression redefining the method which returns the name of objective
      self.obj = LogisticRegression()
  
      self.base_score = self.obj.prob_to_margin(params["base_score"])
  
      # when weights for groups are not provided this equals to a number of instances
      # in data
      # TODO: add weight sum calculation from provided weights, by now always assume
      # default behaviour
      self.num_inst = params["num_instances"]
      self.sum_instance_weight_ = self.num_inst
      self.scale_pos_weight = (
          1.0
          if not params["scale_pos_weight"]
          else params["scale_pos_weight"]
      )
  
      # set to True, because we're assuming default behaviour for group weights
      self.is_null_weights = True
  
      self.is_converged_ = False
      self.tolerance = 0.0
  
      self.num_output_group = params["num_output_group"]
      self.num_feature = params["num_feature"]
  
      # xgboost stores weights in a vector form, but it was decided to store them as a
      # 2D matrix here it simplifies calculations while math remains the same
      # added 1 in the first dim, because xgboost stores weights and biases jointly
      self.weight = ivy.zeros(
          (self.num_feature + 1, self.num_output_group),
          dtype=ivy.float32,
      )
      # used to calculate convergence(comparing max difference of weights to
      # tolerance)
      self.prev_weight = deepcopy(self.weight)
  
      # if base margin is None, use base_score instead
      self.base_margin = (
          params["base_margin"]
          if params["base_margin"]
          else self.base_score
      )
  
      # setup lr and denormalize regularization params for updater
      self.learning_rate = params["learning_rate"]
      self.reg_lambda_denorm = (
          self.sum_instance_weight_ * params["reg_lambda"]
      )
      self.reg_alpha_denorm = (
          self.sum_instance_weight_ * params["reg_alpha"]
      )
  
      # compilation block
      self.compile = compile
      if self.compile:
          # don't enable native compilation for torch, bc it's already fast enough
          # and this only increases the compilation time
          backend_compile = (
              True if ivy.current_backend_str() != "torch" else False
          )
          self._comp_pred = ivy.trace_graph(
              _pred, backend_compile=backend_compile
          )
          self._comp_get_gradient = ivy.trace_graph(
              _get_gradient,
              backend_compile=backend_compile,
              static_argnums=(0,),
          )
          self._comp_updater = ivy.trace_graph(
              self.updater, backend_compile=backend_compile
          )
  
          # run each function to compile it
          # this process doesn't affect the training
          pred = self._comp_pred(
              cache[0], self.weight, self.base_margin
          )
          gpair = self._comp_get_gradient(
              self.obj, pred, cache[1], self.scale_pos_weight
          )
          self._comp_updater(
              gpair,
              cache[0],
              self.learning_rate,
              self.weight,
              self.num_feature,
              0,
              self.reg_alpha_denorm,
              self.reg_lambda_denorm,
          )
  
file_path: ivy/ivy/functional/frontends/xgboost/gbm/gbm.py
imports: import ivy
  from ivy.functional.frontends.xgboost.objective.regression_loss import LogisticRegression
  from ivy.functional.frontends.xgboost.linear.updater_coordinate import coordinate_updater
  from copy import deepcopy
label_desc: Use image node_id 1 to create a new GBLinear object  with example: obj = GBLinear(params, compile, cache)