[SciPy-user] Mysterious kmeans() error

David Cournapeau cournape@gmail....
Fri Feb 6 18:14:55 CST 2009


On Sat, Feb 7, 2009 at 1:25 AM,  <josef.pktd@gmail.com> wrote:
> On Fri, Feb 6, 2009 at 11:05 AM, David Cournapeau <cournape@gmail.com> wrote:
>> On Fri, Feb 6, 2009 at 11:37 PM, Roy H. Han
>> <starsareblueandfaraway@gmail.com> wrote:
>>> Well I feel like there are numerical problems with scipy's kmeans2(),
>>> at least in the 0.6.0 version of scipy.
>>
>> kmeans and kmeans2 are fairly low level - they will fail if you have
>> empty cluster, indeed.
>
> I thought that the tests  test_kmeans_lost_cluster(self) verifies that
> empty clusters
> are handled.

Actually, it tests a warning/exception is raised, instead of silently
fail - so you can for example repeat the kmeans procedure with
different initializations values (that's how I use kmeans in the em
toolbox).

But again, a better kmeans algorithm implementation would be nice - I
just not sure it should be in scipy, though,

David


More information about the SciPy-user mailing list