Support all pandas nullable integer types. (#8480)
- Enumerate all pandas integer types. - Tests for `None`, `nan`, and `pd.NA`
This commit is contained in:
@@ -10,6 +10,7 @@ from xgboost.testing import (
|
||||
make_batches_sparse,
|
||||
make_categorical,
|
||||
make_sparse_regression,
|
||||
predictor_equal,
|
||||
)
|
||||
from xgboost.testing.data import np_dtypes
|
||||
|
||||
@@ -246,11 +247,7 @@ class TestQuantileDMatrix:
|
||||
for orig, x in np_dtypes(n_samples, n_features):
|
||||
m0 = xgb.QuantileDMatrix(orig)
|
||||
m1 = xgb.QuantileDMatrix(x)
|
||||
csr0 = m0.get_data()
|
||||
csr1 = m1.get_data()
|
||||
np.testing.assert_allclose(csr0.data, csr1.data)
|
||||
np.testing.assert_allclose(csr0.indptr, csr1.indptr)
|
||||
np.testing.assert_allclose(csr0.indices, csr1.indices)
|
||||
assert predictor_equal(m0, m1)
|
||||
|
||||
# unsupported types
|
||||
for dtype in [
|
||||
|
||||
Reference in New Issue
Block a user