Skip to content

[MRG] TST Use fixed random state to avoid test failure of test_weighted_vs_repeated#11523

Merged
jnothman merged 1 commit intoscikit-learn:masterfrom
qinhanmin2014:kmeans-test
Jul 16, 2018
Merged

[MRG] TST Use fixed random state to avoid test failure of test_weighted_vs_repeated#11523
jnothman merged 1 commit intoscikit-learn:masterfrom
qinhanmin2014:kmeans-test

Conversation

@qinhanmin2014
Copy link
Copy Markdown
Member

@qinhanmin2014 qinhanmin2014 commented Jul 15, 2018

Fixes #11236

Implement the solution proposed by @jnothman and @ogrisel (I also agree with it)

an alternative is to check that it passes for a reasonable percentage of random_states

I tried seed from 0 to 999, the test only fails when using np.random.seed(973)

I would rather fix the random seed and maybe relax the condition to have a v_measure over 0.9 for the MiniBatchKMeans case.

Since we've used a fixed random state, I keep the check for v_measure.

@qinhanmin2014 qinhanmin2014 changed the title TST Fixed random state to avoid test failure of test_weighted_vs_repeated [MRG] TST Fixed random state to avoid test failure of test_weighted_vs_repeated Jul 15, 2018
@qinhanmin2014 qinhanmin2014 changed the title [MRG] TST Fixed random state to avoid test failure of test_weighted_vs_repeated [MRG] TST Use fixed random state to avoid test failure of test_weighted_vs_repeated Jul 15, 2018
@jnothman jnothman merged commit 074a521 into scikit-learn:master Jul 16, 2018
@qinhanmin2014 qinhanmin2014 deleted the kmeans-test branch July 17, 2018 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test test_weighted_vs_repeated is somehow flaky

2 participants