code: def test_eval_metrics(self):
      try:
          from sklearn.model_selection import train_test_split
      except ImportError:
          from sklearn.cross_validation import train_test_split
      from sklearn.datasets import load_digits
  
      digits = load_digits(n_class=2)
      X = digits["data"]
      y = digits["target"]
  
      Xt, Xv, yt, yv = train_test_split(
          X, y, test_size=0.2, random_state=0
      )
  
      dtrain = xgb.DMatrix(Xt, label=yt)
      dvalid = xgb.DMatrix(Xv, label=yv)
  
      watchlist = [(dtrain, "train"), (dvalid, "val")]
  
      gbdt_01 = xgb.train(
          self.xgb_params_01, dtrain, num_boost_round=10
      )
      gbdt_02 = xgb.train(
          self.xgb_params_02, dtrain, num_boost_round=10
      )
      gbdt_03 = xgb.train(
          self.xgb_params_03, dtrain, num_boost_round=10
      )
      assert gbdt_01.predict(dvalid)[0] == gbdt_02.predict(dvalid)[0]
      assert gbdt_01.predict(dvalid)[0] == gbdt_03.predict(dvalid)[0]
  
      gbdt_01 = xgb.train(
          self.xgb_params_01,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
      )
      gbdt_02 = xgb.train(
          self.xgb_params_02,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
      )
      gbdt_03 = xgb.train(
          self.xgb_params_03,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
      )
      gbdt_04 = xgb.train(
          self.xgb_params_04,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
      )
      assert gbdt_01.predict(dvalid)[0] == gbdt_02.predict(dvalid)[0]
      assert gbdt_01.predict(dvalid)[0] == gbdt_03.predict(dvalid)[0]
      assert gbdt_03.predict(dvalid)[0] != gbdt_04.predict(dvalid)[0]
  
      gbdt_01 = xgb.train(
          self.xgb_params_01,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
          feval=self.evalerror_01,
      )
      gbdt_02 = xgb.train(
          self.xgb_params_02,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
          feval=self.evalerror_02,
      )
      gbdt_03 = xgb.train(
          self.xgb_params_03,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
          feval=self.evalerror_03,
      )
      gbdt_04 = xgb.train(
          self.xgb_params_04,
          dtrain,
          10,
          watchlist,
          early_stopping_rounds=2,
          feval=self.evalerror_04,
      )
      assert gbdt_01.predict(dvalid)[0] == gbdt_02.predict(dvalid)[0]
      assert gbdt_01.predict(dvalid)[0] == gbdt_03.predict(dvalid)[0]
      assert gbdt_03.predict(dvalid)[0] != gbdt_04.predict(dvalid)[0]
  
imports: import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.metrics import check_precision_score, check_quantile_error
label_desc: Use image node_id 5 for calling the TestEvalMetrics obj's underlying member method code with example usage: obj.test_eval_metrics() without return types