Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HierarchicalClustering Losing Values #11
Hi, and thanks for the library!
I’m losing values though:
I’ll try to understand the algorithm to see where the 30 went, but maybe you’re quicker.
The bug occurs when there are two equal values in the list (unless they’re consecutive, so that the second one gets the index of the first when the first is removed).
Instead of this (cluster.py around line 637):
You could also obtain both the values first and only then delete them, but the above seems simpler.
Thanks for the update. I'll see to it in the near future.
Have you tested your proposed solution? I'm not on my dev-box right now. Also... this is a fairly old piece of library. I'll have to dig bag in an understand my own code again... with any luck it should not take all too long ^_^
Also, you could propose a pull-request to speed things up ;)
added a commit
Aug 29, 2014
Sorry for the delay... We had a death in the family, and I still am a bit shaken.
But this problem in keeps me awake at night... I have been working on a better unit-test (see http://michel.albert.lu). Alas, implementing a test with that data set did not reproduce the error!
I have now taken up the original values from the unit-test, and while writing up I realised that one value is duplicated (