code: def __init__(
      self, params=None, cache=None, model_file=None, compile=False
  ):
      # cache[0] refers to input data while cache[1] refers to input target
      n_feat = cache[0].shape[1]
      n_inst = cache[0].shape[0]
      n_output_group = ivy.unique_values(cache[1]).shape[0]
  
      # by default xgboost calculates the mean of a target if base_score is not
      # provided
      params["base_score"] = (
          cache[1].mean()
          if not params["base_score"]
          else params["base_score"]
      )
  
      # add num_feature, num_target and num_instances to params
      params.update(
          {
              "num_feature": n_feat,
              "num_output_group": n_output_group - 1,
              "num_instances": n_inst,
          }
      )
  
      # create gbm(as for now only gblinear booster is available)
      self.gbm = GBLinear(params, compile=compile, cache=cache)
      self.compile = compile
      if self.compile:
          self._comp_binary_prediction = ivy.trace_graph(
              _binary_prediction,
              backend_compile=True,
              static_argnums=(0,),
          )
  
          # invoke function to get its compiled version
          self._comp_binary_prediction(self.gbm.obj, cache[1])
  
file_path: ivy/ivy/functional/frontends/xgboost/core.py
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .gbm import GBLinear
label_desc: Use image node_id 1 to create a new Booster object  with example: obj = Booster(params, cache, model_file, compile)