Mitigate flaky data iter test. (#8244)

- Reduce the number of batches.
- Verify labels.
This commit is contained in:
Jiaming Yuan
2022-09-14 17:54:14 +08:00
committed by GitHub
parent bdf265076d
commit 2e63af6117
3 changed files with 13 additions and 3 deletions

View File

@@ -92,6 +92,12 @@ def run_data_iterator(
assert non_increasing(results_from_it["Train"]["rmse"])
X, y, w = it.as_arrays()
if use_cupy:
_y = y.get()
else:
_y = y
np.testing.assert_allclose(Xy.get_label(), _y)
Xy = xgb.DMatrix(X, y, weight=w)
assert Xy.num_row() == n_samples_per_batch * n_batches
assert Xy.num_col() == n_features