diff --git a/tests/python/test_quantile_dmatrix.py b/tests/python/test_quantile_dmatrix.py index 0e0aaed08..c1ec23ea3 100644 --- a/tests/python/test_quantile_dmatrix.py +++ b/tests/python/test_quantile_dmatrix.py @@ -253,9 +253,12 @@ class TestQuantileDMatrix: self.run_ref_dmatrix(rng, "hist", True) self.run_ref_dmatrix(rng, "hist", False) - def test_predict(self) -> None: - n_samples, n_features = 16, 2 - X, y = make_categorical(n_samples, n_features, n_categories=13, onehot=False) + @pytest.mark.parametrize("sparsity", [0.0, 0.5]) + def test_predict(self, sparsity: float) -> None: + 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) booster = xgb.train({"tree_method": "hist"}, Xy)