Repository navigation
TST Relax test_minibatch_sensible_reassign to avoid CI failures with single global random seed - #29278
Conversation
|
Some observations
|
|
For all the failing builds the number of clusters is 10, so using > 9 may be a quick fix: |
test_minibatch_sensible_reassign
test_minibatch_sensible_reassign
|
I tested all the random seeds in the CI and the only problematic seed on all four failing builds is free-threaded fails with Haskell (still can't reproduce locally though with same CPU architecture ...), the two other failing builds using OpenBLAS are using SkyLakeX, the MKL one we don't know ( |
test_minibatch_sensible_reassign
test_minibatch_sensible_reassign
|
Relaxing the number of clusters check to be |
test_minibatch_sensible_reassign to avoid CI failures with single global random seed
| # there should not be too many exact zero cluster centers | ||
| assert km.cluster_centers_.any(axis=1).sum() > 10 | ||
| num_non_zero_clusters = km.cluster_centers_.any(axis=1).sum() | ||
| assert num_non_zero_clusters > 9, f"{num_non_zero_clusters=} is too small" |
There was a problem hiding this comment.
I added assertion string (i.e. second argument in the assert, not sure if there is a more exact name) because it seems like pytest assertion rewriting is a bit broken (needs a bit of investigation as to why). If this ever fails again, at least the message will tell how far we are from the threshold
jeremiedbb
left a comment
There was a problem hiding this comment.
LGTM. Ideally the test should be reworked with assertion where we know in advance what we really expect, but let's go with this quick tweak for now.
…h single global random seed (scikit-learn#29278)
…h single global random seed (scikit-learn#29278)
…h single global random seed (#29278)
Close #29253.
Summarising my comments below, relaxing the check to be
> 9instead of> 10makes the CI pass on all random seeds, see Azure logs on PR commit 162684a. I have not been able to reproduce the issue locally.This issue has been seen in multiple CI builds from time to time e.g. #27967 (comment) or #26802 (comment)