Add more tests and doc for QDM. (#10692)

This commit is contained in:
Jiaming Yuan
2024-08-16 23:30:04 +08:00
committed by GitHub
parent 582ea104b5
commit 2258bc870d
7 changed files with 61 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ from xgboost.testing import (
)
from xgboost.testing.data import check_inf, np_dtypes
from xgboost.testing.data_iter import run_mixed_sparsity
from xgboost.testing.quantile_dmatrix import check_ref_quantile_cut
class TestQuantileDMatrix:
@@ -266,6 +267,9 @@ class TestQuantileDMatrix:
dm_results["dvalid"]["rmse"], qdm_results["valid"]["rmse"]
)
def test_ref_quantile_cut(self) -> None:
check_ref_quantile_cut("cpu")
def test_ref_dmatrix(self) -> None:
rng = np.random.RandomState(1994)
self.run_ref_dmatrix(rng, "hist", True)

View File

@@ -412,4 +412,4 @@ class TestTreeMethod:
@pytest.mark.skipif(**tm.no_pandas())
@pytest.mark.parametrize("tree_method", ["hist"])
def test_get_quantile_cut(self, tree_method: str) -> None:
check_get_quantile_cut(tree_method)
check_get_quantile_cut(tree_method, "cpu")