docstr: Fit on the training data from scratch.
  Since the rolling process is very customized in this model,
  we enclose the rolling process inside this method.
  :param verbose:
  :return: the evaluation metric value
docstr_tok: ["Fit","on","the","training","data","from","scratch",".","Since","the","rolling","process","is","very","customized","in","this","model",",","we","enclose","the","rolling","process","inside","this","method",".",":","param","verbose",":",":","return",":","the","evaluation","metric","value"]
code: def fit_eval(
      self,
      data,
      validation_data=None,
      metric=None,
      metric_func=None,
      **config,
  ):
      """
      Fit on the training data from scratch.
      Since the rolling process is very customized in this model,
      we enclose the rolling process inside this method.
      :param verbose:
      :return: the evaluation metric value
      """
      if not self.model_init:
          self._build(**config)
  
      data = self._validate_data(data, "data")
      x, y = data[0], data[1]
      if validation_data is not None:
          if isinstance(validation_data, list):
              validation_data = validation_data[0]
          validation_data = self._validate_data(
              validation_data, "validation_data"
          )
          eval_set = [validation_data]
      else:
          eval_set = None
  
      valid_metric_names = (
          XGB_METRIC_NAME | Evaluator.metrics_func.keys()
      )
      default_metric = (
          "rmse" if self.model_type == "regressor" else "logloss"
      )
      if not metric and metric_func:
          metric_name = metric_func.__name__
      else:
          metric_name = metric or self.metric or default_metric
  
      if not metric_func and metric_name not in valid_metric_names:
          raise ValueError(
              f"Got invalid metric name of {metric_name} for XGBoost. Valid metrics "
              f"are {valid_metric_names}"
          )
  
      if metric_name in XGB_METRIC_NAME and not metric_func:
          self.model.fit(
              x, y, eval_set=eval_set, eval_metric=metric_name
          )
          vals = self.model.evals_result_.get("validation_0").get(
              metric_name
          )
          return {metric_name: vals[-1]}
      else:
          self.model.fit(
              x, y, eval_set=eval_set, eval_metric=default_metric
          )
          eval_result = self.evaluate(
              validation_data[0],
              validation_data[1],
              metrics=[metric_func or metric_name],
          )[0]
          return {metric_name: eval_result}
  
imports: import pickle
  import pandas
  from xgboost.sklearn import XGBRegressor
  from xgboost.sklearn import XGBClassifier
  from zoo.orca.automl.metrics import Evaluator
  from zoo.orca.automl.model.abstract import BaseModel, ModelBuilder
  import logging
label_desc: Use image node_id 4 for calling the XGBoost obj's underlying member method code with example usage: obj.fit_eval(data, validation_data, metric, metric_func) and returns: dict, dict