code: def run_pr_auc_binary(self, tree_method):
      from sklearn.datasets import make_classification
      from sklearn.metrics import auc, precision_recall_curve
  
      X, y = make_classification(128, 4, n_classes=2, random_state=1994)
      clf = xgb.XGBClassifier(
          tree_method=tree_method, n_estimators=1, eval_metric="aucpr"
      )
      clf.fit(X, y, eval_set=[(X, y)])
      evals_result = clf.evals_result()["validation_0"]["aucpr"][-1]
  
      y_score = clf.predict_proba(X)[:, 1]  # get the positive column
      precision, recall, _ = precision_recall_curve(y, y_score)
      prauc = auc(recall, precision)
      # Interpolation results are slightly different from sklearn, but overall should
      # be similar.
      np.testing.assert_allclose(prauc, evals_result, rtol=1e-2)
  
      clf = xgb.XGBClassifier(
          tree_method=tree_method, n_estimators=10, eval_metric="aucpr"
      )
      clf.fit(X, y, eval_set=[(X, y)])
      evals_result = clf.evals_result()["validation_0"]["aucpr"][-1]
      np.testing.assert_allclose(0.99, evals_result, rtol=1e-2)
  
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 12 for calling the TestEvalMetrics obj's underlying member method code with example usage: obj.run_pr_auc_binary(tree_method) without return types