Test QDM with sparse data on CPU. (#9316)
This commit is contained in:
parent
ee6809e642
commit
6d22ea793c
@ -253,9 +253,12 @@ class TestQuantileDMatrix:
|
|||||||
self.run_ref_dmatrix(rng, "hist", True)
|
self.run_ref_dmatrix(rng, "hist", True)
|
||||||
self.run_ref_dmatrix(rng, "hist", False)
|
self.run_ref_dmatrix(rng, "hist", False)
|
||||||
|
|
||||||
def test_predict(self) -> None:
|
@pytest.mark.parametrize("sparsity", [0.0, 0.5])
|
||||||
n_samples, n_features = 16, 2
|
def test_predict(self, sparsity: float) -> None:
|
||||||
X, y = make_categorical(n_samples, n_features, n_categories=13, onehot=False)
|
n_samples, n_features = 256, 4
|
||||||
|
X, y = make_categorical(
|
||||||
|
n_samples, n_features, n_categories=13, onehot=False, sparsity=sparsity
|
||||||
|
)
|
||||||
Xy = xgb.DMatrix(X, y, enable_categorical=True)
|
Xy = xgb.DMatrix(X, y, enable_categorical=True)
|
||||||
|
|
||||||
booster = xgb.train({"tree_method": "hist"}, Xy)
|
booster = xgb.train({"tree_method": "hist"}, Xy)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user