kwikteam / klustakwik2

Fast software for high-dimensional cluster analysis using the masked EM algorithm for Gaussians mixtures
BSD 3-Clause "New" or "Revised" License
31 stars 13 forks source link

Random test error on klustakwik2.tests.test_synthetic_data.test_synthetic_4d_easy_non_gaussian #49

Closed nippoo closed 9 years ago

nippoo commented 9 years ago

Reproducibly, a cycle happens and the clustering does not complete. However it still returns with "OK" about half the time.

[snip]
INFO     klustakwik.split_candidate: Clustering data set of 1000 points, 4 features
INFO     klustakwik.split_candidate: Starting iteration 0 with 2 clusters
INFO     klustakwik.split_candidate: Iteration 1F: 2 clusters, 464 changed, score=-1241.813601
INFO     klustakwik.split_candidate: Iteration 2F: 2 clusters, 91 changed, score=-1737.117827 (decreased by 495.304227)
ERROR    klustakwik.split_candidate: Cycle detected! Splitting is not enabled, so abandoning.
INFO     klustakwik: No points changed, previous step was full and did not split, so finishing.
.
======================================================================
FAIL: klustakwik2.tests.test_synthetic_data.test_synthetic_4d_easy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nippoo/.conda/envs/klustakwik2/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/nippoo/Development/klustakwik2/klustakwik2/tests/test_synthetic_data.py", line 113, in test_synthetic_4d_easy
    assert len(unique(kk.clusters[0:1000]))==1
AssertionError

----------------------------------------------------------------------
Ran 14 tests in 2.889s
nippoo commented 9 years ago

This seems to happen about 75% of the time on my computer (on master), as well as on travis. Restarting the tests makes it work fine... sometimes.

thesamovar commented 9 years ago

This should be relatively easy to fix, and now we have a test system maybe it should be a priority.

nippoo commented 9 years ago

Yup! Weirdly enough, it exits due to cycle splitting pretty much every time (20/20 so far) but only sometimes has one cluster.

(Probably best to merge #40 before fixing this so there aren't too many merge conflicts)

thesamovar commented 9 years ago

So I've temporarily disabled the test that was causing the problem. We do need to address it though, but better to have a working test suite for the moment.