class_docstr: Callback function for xgboost.
  Support custom evaluation function and early-stopping.
class_docstr_tok: ["Callback","function","for","xgboost",".","Support","custom","evaluation","function","and","early-stopping","."]
docstr: Init function
docstr_tok: ["Init","function"]
code: def __init__(
      self,
      stopping_rounds,
      metric,
      fevals,
      evals=(),
      log_file=None,
      maximize=False,
      verbose_eval=True,
      skip_every=2,
  ):
      """Init function"""
      self.stopping_rounds = stopping_rounds
      self.metric = metric
      self.metric_shortname = metric.split("-")[1]
      self.fevals = fevals
      self.evals = evals
      self.log_file = log_file
      self.maximize = maximize
      self.verbose_eval = verbose_eval
      self.skip_every = skip_every
      self.state = {}
  
imports: import multiprocessing
  import logging
  from typing import Dict
  from collections import defaultdict
  import numpy
  from tvm.autotvm.tuner.metric import max_curve
  from .cost_model import PythonBasedModel
  from ..feature import get_per_store_features_from_measure_pairs, get_per_store_features_from_states
  from ..measure_record import RecordReader
label_desc: Use image node_id 1 to create a new CustomCallback object from inherited base classes: XGBoostCallback with example: obj = CustomCallback(stopping_rounds, metric, fevals, evals, log_file, maximize, verbose_eval, skip_every)