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').

Well done!! The function worked perfectly until I had a black background with white line art. This simple fix will always print it as it's shown in the figure.

I'd suggest adding this line:

set(h,'InvertHardCopy','off');

27 Jan 2014

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

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?

Well done!! The function worked perfectly until I had a black background with white line art. This simple fix will always print it as it's shown in the figure.
I'd suggest adding this line:
set(h,'InvertHardCopy','off');

5

27 Jan 2014

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

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