Rework the precision metric. (#9222)

- Rework the precision metric for both CPU and GPU.
- Mention it in the document.
- Cleanup old support code for GPU ranking metric.
- Deterministic GPU implementation.

* Drop support for classification.

* type.

* use batch shape.

* lint.

* cpu build.

* cpu build.

* lint.

* Tests.

* Fix.

* Cleanup error message.
This commit is contained in:
Jiaming Yuan
2023-06-02 20:49:43 +08:00
committed by GitHub
parent db8288121d
commit 9fbde21e9d
22 changed files with 312 additions and 502 deletions

View File

@@ -3,7 +3,7 @@ import pytest
import xgboost as xgb
from xgboost import testing as tm
from xgboost.testing.metrics import check_quantile_error
from xgboost.testing.metrics import check_precision_score, check_quantile_error
rng = np.random.RandomState(1337)
@@ -315,6 +315,9 @@ class TestEvalMetrics:
def test_pr_auc_ltr(self):
self.run_pr_auc_ltr("hist")
def test_precision_score(self):
check_precision_score("hist")
@pytest.mark.skipif(**tm.no_sklearn())
def test_quantile_error(self) -> None:
check_quantile_error("hist")