k-means++
Cluster multivariate data using the k-means++ algorithm.
Author: Laurent S

@Matei Tene: dot(C,C) is actually implemented as sum(C.*conj(C)), making both are equally fast.

08 Feb 2013

k-means++
Cluster multivariate data using the k-means++ algorithm.
Author: Laurent S

@Xiaobo Li: Thank you for your comment, I updated the code so that it works with 1D datasets. The update should appear on the File Exchange shortly.

02 Jan 2012

k-means++
Cluster multivariate data using the k-means++ algorithm.
Author: Laurent S

@Micky: Good catch :-) Yes, using the distance instead of squared distance shows consistently better results on the datasets used by the original authors. If you happen to find a better heuristic, I would be happy to hear about it of course!

21 Dec 2011

k-means++
Cluster multivariate data using the k-means++ algorithm.
Author: Laurent S

@Andreas: Thanks! To answer your question: you could try using PCA on the cluster centers to discover which clusters are the most important (although it depends on how you define 'important').

I'm having a bit of trouble understanding the bsxfun lines. Is there any documentation or explanation of why you are maximizing this and how it relates to the distance, can't quite understand where the C' comes from?

Thanks.

22 Oct 2013

k-means++
Cluster multivariate data using the k-means++ algorithm.
Author: Laurent S

First of all thanks for the code. I actually trying to use kmeans to bin my 1D data, the C output could be used as the bin centers. However, if I want the function to output edges is there a non-trivial way to do it?

I have code:
nfo = imfinfo('im.png');
X = im2double(imread('im','png'));
X = imadjust(X);
k = 4;
and kmeanspp??
I want to output the resulting image
for example:
X=kmeanspp(X,k);
how can I do?
thanks
I am an Italian student

Comment only

10 Jan 2014

k-means++
Cluster multivariate data using the k-means++ algorithm.

Hi Laurent,
I'm having a bit of trouble understanding the bsxfun lines. Is there any documentation or explanation of why you are maximizing this and how it relates to the distance, can't quite understand where the C' comes from?
Thanks.

Comment only

22 Oct 2013

k-means++
Cluster multivariate data using the k-means++ algorithm.

Hi Laurent,
First of all thanks for the code. I actually trying to use kmeans to bin my 1D data, the C output could be used as the bin centers. However, if I want the function to output edges is there a non-trivial way to do it?
Thanks.

Comment only