docstr: Fit gradient boosting model.
  
  Note that calling ``fit()`` multiple times will cause the model object to be
  re-fit from scratch. To resume training from a previous checkpoint, explicitly
  pass ``xgb_model`` argument.
  
  Parameters
  ----------
  X
      Feature matrix.
  
      When the ``tree_method`` is set to ``hist``, internally, the
      `QuantileDMatrix` will be used instead of the `DMatrix`
      for conserving memory. However, this has performance implications when the
      device of input data is not matched with algorithm. For instance, if the
      input is a numpy array on CPU but ``cuda`` is used for training, then the
      data is first processed on CPU then transferred to GPU.
  y
      Labels.
  sample_weight
      instance weights.
  base_margin
      global bias for each instance.
  eval_set
      A list of (X, y) tuple pairs to use as validation sets, for which
      metrics will be computed.
      Validation metrics will help us track the performance of the model.
  eval_metric
      str, list of str, or callable, optional(deprecated in fit method).
  early_stopping_rounds
      int(deprecated in fit method).
  verbose
      If `verbose` is True and an evaluation set is used, the evaluation metric
      measured on the validation set is printed to stdout at each boosting stage.
      If `verbose` is an integer, the evaluation metric is printed at each
      `verbose` boosting stage. The last boosting stage / the boosting stage found
      by using `early_stopping_rounds` is also printed.
  xgb_model
      file name of stored XGBoost model or 'Booster' instance XGBoost model to be
      loaded before training (allows training continuation).
  sample_weight_eval_set
      A list of the form [L_1, L_2, ..., L_n], where each L_i is an array like
      object storing instance weights for the i-th validation set.
  base_margin_eval_set
      A list of the form [M_1, M_2, ..., M_n], where each M_i is an array like
      object storing base margin for the i-th validation set.
  feature_weights
      Weight for each feature, defines the probability of each feature being
      selected when colsample is being used.  All values must be greater than 0,
      otherwise a `ValueError` is thrown.
  callbacks
      (deprecated in fit method).
docstr_tok: ["Fit","gradient","boosting","model",".","Note","that","calling","``","fit","(",")","``","multiple","times","will","cause","the","model","object","to","be","re-fit","from","scratch",".","To","resume","training","from","a","previous","checkpoint",",","explicitly","pass","``","xgb_model","``","argument",".","Parameters","--","--","--","--","--","X","Feature","matrix",".","When","the","``","tree_method","``","is","set","to","``","hist","``",",","internally",",","the","`","QuantileDMatrix","`","will","be","used","instead","of","the","`","DMatrix","`","for","conserving","memory",".","However",",","this","has","performance","implications","when","the","device","of","input","data","is","not","matched","with","algorithm",".","For","instance",",","if","the","input","is","a","numpy","array","on","CPU","but","``","cuda","``","is","used","for","training",",","then","the","data","is","first","processed","on","CPU","then","transferred","to","GPU",".","y","Labels",".","sample_weight","instance","weights",".","base_margin","global","bias","for","each","instance",".","eval_set","A","list","of","(","X",",","y",")","tuple","pairs","to","use","as","validation","sets",",","for","which","metrics","will","be","computed",".","Validation","metrics","will","help","us","track","the","performance","of","the","model",".","eval_metric","str",",","list","of","str",",","or","callable",",","optional","(","deprecated","in","fit","method",")",".","early_stopping_rounds","int","(","deprecated","in","fit","method",")",".","verbose","If","`","verbose","`","is","True","and","an","evaluation","set","is","used",",","the","evaluation","metric","measured","on","the","validation","set","is","printed","to","stdout","at","each","boosting","stage",".","If","`","verbose","`","is","an","integer",",","the","evaluation","metric","is","printed","at","each","`","verbose","`","boosting","stage",".","The","last","boosting","stage","\/","the","boosting","stage","found","by","using","`","early_stopping_rounds","`","is","also","printed",".","xgb_model","file","name","of","stored","XGBoost","model","or","'Booster","'","instance","XGBoost","model","to","be","loaded","before","training","(","allows","training","continuation",")",".","sample_weight_eval_set","A","list","of","the","form","[","L_1",",","L_2",",","...",",","L_n","]",",","where","each","L_i","is","an","array","like","object","storing","instance","weights","for","the","i-th","validation","set",".","base_margin_eval_set","A","list","of","the","form","[","M_1",",","M_2",",","...",",","M_n","]",",","where","each","M_i","is","an","array","like","object","storing","base","margin","for","the","i-th","validation","set",".","feature_weights","Weight","for","each","feature",",","defines","the","probability","of","each","feature","being","selected","when","colsample","is","being","used",".","All","values","must","be","greater","than","0",",","otherwise","a","`","ValueError","`","is","thrown",".","callbacks","(","deprecated","in","fit","method",")","."]
code: def fit(
      self,
      X,
      y,
      *,
      sample_weight=None,
      base_margin=None,
      eval_set=None,
      eval_metric=None,
      early_stopping_rounds=None,
      verbose=True,
      xgb_model=None,
      sample_weight_eval_set=None,
      base_margin_eval_set=None,
      feature_weights=None,
      callbacks=None,
  ):
      """Fit gradient boosting model.
  
      Note that calling ``fit()`` multiple times will cause the model object to be
      re-fit from scratch. To resume training from a previous checkpoint, explicitly
      pass ``xgb_model`` argument.
  
      Parameters
      ----------
      X
          Feature matrix.
  
          When the ``tree_method`` is set to ``hist``, internally, the
          `QuantileDMatrix` will be used instead of the `DMatrix`
          for conserving memory. However, this has performance implications when the
          device of input data is not matched with algorithm. For instance, if the
          input is a numpy array on CPU but ``cuda`` is used for training, then the
          data is first processed on CPU then transferred to GPU.
      y
          Labels.
      sample_weight
          instance weights.
      base_margin
          global bias for each instance.
      eval_set
          A list of (X, y) tuple pairs to use as validation sets, for which
          metrics will be computed.
          Validation metrics will help us track the performance of the model.
      eval_metric
          str, list of str, or callable, optional(deprecated in fit method).
      early_stopping_rounds
          int(deprecated in fit method).
      verbose
          If `verbose` is True and an evaluation set is used, the evaluation metric
          measured on the validation set is printed to stdout at each boosting stage.
          If `verbose` is an integer, the evaluation metric is printed at each
          `verbose` boosting stage. The last boosting stage / the boosting stage found
          by using `early_stopping_rounds` is also printed.
      xgb_model
          file name of stored XGBoost model or 'Booster' instance XGBoost model to be
          loaded before training (allows training continuation).
      sample_weight_eval_set
          A list of the form [L_1, L_2, ..., L_n], where each L_i is an array like
          object storing instance weights for the i-th validation set.
      base_margin_eval_set
          A list of the form [M_1, M_2, ..., M_n], where each M_i is an array like
          object storing base margin for the i-th validation set.
      feature_weights
          Weight for each feature, defines the probability of each feature being
          selected when colsample is being used.  All values must be greater than 0,
          otherwise a `ValueError` is thrown.
      callbacks
          (deprecated in fit method).
      """
      # skip all the validation as we're interested in calculations for now
      # ToDo: add handling for custom objective
      if self.compiled:
          for i in range(self.get_num_boosting_rounds()):
              self._Booster.update(X, y, i)
      else:
          params = self.get_xgb_params()
          self._Booster = train(
              params, X, y, self.get_num_boosting_rounds()
          )
  
      return self
  
file_path: ivy/ivy/functional/frontends/xgboost/sklearn.py
imports: import ivy
  from ivy.functional.frontends.sklearn.base import BaseEstimator
  from ivy.functional.frontends.sklearn.base import ClassifierMixin
  from .training import train
  from .core import Booster
label_desc: Use image node_id 8 for calling the XGBModel obj's underlying member method code with example usage: obj.fit(X, y) and returns: self