[CI] Fix PyLint errors. (#10837)

This commit is contained in:
Jiaming Yuan
2024-09-24 14:09:32 +08:00
committed by GitHub
parent 982ee34658
commit 68a8865bc5
26 changed files with 349 additions and 118 deletions

View File

@@ -195,7 +195,7 @@ class TestFromColumnar:
@pytest.mark.skipif(**tm.no_cudf())
def test_cudf_categorical(self) -> None:
n_features = 30
_X, _y = tm.make_categorical(100, n_features, 17, False)
_X, _y = tm.make_categorical(100, n_features, 17, onehot=False)
X = cudf.from_pandas(_X)
y = cudf.from_pandas(_y)
@@ -312,7 +312,7 @@ class IterForDMatrixTest(xgb.core.DataIter):
self._data = []
self._labels = []
for i in range(self.BATCHES):
X, y = tm.make_categorical(self.ROWS_PER_BATCH, 4, 13, False)
X, y = tm.make_categorical(self.ROWS_PER_BATCH, 4, 13, onehot=False)
self._data.append(cudf.from_pandas(X))
self._labels.append(y)
else:

View File

@@ -405,7 +405,7 @@ class TestGPUPredict:
)
def test_shap_categorical(self):
X, y = tm.make_categorical(100, 20, 7, False)
X, y = tm.make_categorical(100, 20, 7, onehot=False)
Xy = xgb.DMatrix(X, y, enable_categorical=True)
booster = xgb.train(
{"tree_method": "hist", "device": "gpu:0"}, Xy, num_boost_round=10

View File

@@ -140,7 +140,14 @@ class TestGPUUpdaters:
@settings(deadline=None, max_examples=20, print_blob=True)
@pytest.mark.skipif(**tm.no_pandas())
def test_categorical_ohe(self, rows, cols, rounds, cats):
check_categorical_ohe(rows, cols, rounds, cats, "cuda", "hist")
check_categorical_ohe(
rows=rows,
cols=cols,
rounds=rounds,
cats=cats,
device="cuda",
tree_method="hist",
)
@given(
tm.categorical_dataset_strategy,
@@ -222,10 +229,9 @@ class TestGPUUpdaters:
def test_categorical_32_cat(self):
"""32 hits the bound of integer bitset, so special test"""
rows = 1000
cols = 10
cats = 32
rounds = 4
check_categorical_ohe(rows, cols, rounds, cats, "cuda", "hist")
check_categorical_ohe(
rows=rows, cols=10, rounds=4, cats=32, device="cuda", tree_method="hist"
)
@pytest.mark.skipif(**tm.no_cupy())
def test_invalid_category(self):