Re: k-means example behavior

2015-02-25 Thread Vasiliki Kalavri
Thanks for the replies guys! @Aljoscha: I get your point, but I would actually expect either an error message or the lonely centroid to move. k-means is supposed to cluster data in k clusters. If you end up with < k, something must have gone wrong.. :s @Alex: very helpful resource, thanks. I will

Re: k-means example behavior

2015-02-25 Thread Alexander Alexandrov
Apache's commons-math implementation offers various strategies for handling this scenarios: http://commons.apache.org/proper/commons-math/jacoco/org.apache.commons.math3.stat.clustering/KMeansPlusPlusClusterer.java.html (take a look at the EmptyClusterStrategy enum options) 2015-02-24 23:28 GMT+

Re: k-means example behavior

2015-02-24 Thread Aljoscha Krettek
I think the behaviour is correct. If a cluster has not points then it has no centroid. If it has no centroid no points could ever be assigned to it again in the future since there is no way of calculating a distance. On Tue, Feb 24, 2015 at 6:57 PM, Vasiliki Kalavri wrote: > Hello everyone, > > I

k-means example behavior

2015-02-24 Thread Vasiliki Kalavri
Hello everyone, I'm using the k-means example as basis for a custom implementation and I noticed the following behavior: If during an iteration no point is assigned to a particular cluster, this cluster will then "disappear". This happens because SelectNearestCenter() outputs tuples, (where centr