<s>
In	O
data	B-Application
mining	I-Application
,	O
k-means	B-Algorithm
++	I-Algorithm
is	O
an	O
algorithm	O
for	O
choosing	O
the	O
initial	O
values	O
(	O
or	O
"	O
seeds	O
"	O
)	O
for	O
the	O
k-means	B-Algorithm
clustering	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
It	O
was	O
proposed	O
in	O
2007	O
by	O
David	O
Arthur	O
and	O
Sergei	O
Vassilvitskii	O
,	O
as	O
an	O
approximation	O
algorithm	O
for	O
the	O
NP-hard	O
k-means	B-Algorithm
problema	O
way	O
of	O
avoiding	O
the	O
sometimes	O
poor	O
clusterings	O
found	O
by	O
the	O
standard	O
k-means	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
k-means	B-Algorithm
problem	O
is	O
to	O
find	O
cluster	O
centers	O
that	O
minimize	O
the	O
intra-class	O
variance	O
,	O
i.e.	O
</s>
<s>
Although	O
finding	O
an	O
exact	O
solution	O
to	O
the	O
k-means	B-Algorithm
problem	O
for	O
arbitrary	O
input	O
is	O
NP-hard	O
,	O
the	O
standard	O
approach	O
to	O
finding	O
an	O
approximate	O
solution	O
(	O
often	O
called	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
or	O
the	O
k-means	B-Algorithm
algorithm	I-Algorithm
)	O
is	O
used	O
widely	O
and	O
frequently	O
finds	O
reasonable	O
solutions	O
quickly	O
.	O
</s>
<s>
However	O
,	O
the	O
k-means	B-Algorithm
algorithm	I-Algorithm
has	O
at	O
least	O
two	O
major	O
theoretic	O
shortcomings	O
:	O
</s>
<s>
The	O
k-means	B-Algorithm
++	I-Algorithm
algorithm	O
addresses	O
the	O
second	O
of	O
these	O
obstacles	O
by	O
specifying	O
a	O
procedure	O
to	O
initialize	O
the	O
cluster	O
centers	O
before	O
proceeding	O
with	O
the	O
standard	O
k-means	B-Algorithm
optimization	O
iterations	O
.	O
</s>
<s>
With	O
the	O
k-means	B-Algorithm
++	I-Algorithm
initialization	O
,	O
the	O
algorithm	O
is	O
guaranteed	O
to	O
find	O
a	O
solution	O
that	O
is	O
O(logk )	O
competitive	O
to	O
the	O
optimal	O
k-means	B-Algorithm
solution	O
.	O
</s>
<s>
To	O
illustrate	O
the	O
potential	O
of	O
the	O
k-means	B-Algorithm
algorithm	I-Algorithm
to	O
perform	O
arbitrarily	O
poorly	O
with	O
respect	O
to	O
the	O
objective	O
function	O
of	O
minimizing	O
the	O
sum	O
of	O
squared	O
distances	O
of	O
cluster	O
points	O
to	O
the	O
centroid	O
of	O
their	O
assigned	O
clusters	O
,	O
consider	O
the	O
example	O
of	O
four	O
points	O
in	O
R2	O
that	O
form	O
an	O
axis-aligned	O
rectangle	O
whose	O
width	O
is	O
greater	O
than	O
its	O
height	O
.	O
</s>
<s>
If	O
k	O
=	O
2	O
and	O
the	O
two	O
initial	O
cluster	O
centers	O
lie	O
at	O
the	O
midpoints	O
of	O
the	O
top	O
and	O
bottom	O
line	O
segments	O
of	O
the	O
rectangle	O
formed	O
by	O
the	O
four	O
data	O
points	O
,	O
the	O
k-means	B-Algorithm
algorithm	I-Algorithm
converges	O
immediately	O
,	O
without	O
moving	O
these	O
cluster	O
centers	O
.	O
</s>
<s>
The	O
standard	O
k-means	B-Algorithm
algorithm	I-Algorithm
will	O
continue	O
to	O
cluster	O
the	O
points	O
suboptimally	O
,	O
and	O
by	O
increasing	O
the	O
horizontal	O
distance	O
between	O
the	O
two	O
data	O
points	O
in	O
each	O
cluster	O
,	O
we	O
can	O
make	O
the	O
algorithm	O
perform	O
arbitrarily	O
poorly	O
with	O
respect	O
to	O
the	O
k-means	B-Algorithm
objective	O
function	O
.	O
</s>
<s>
Now	O
that	O
the	O
initial	O
centers	O
have	O
been	O
chosen	O
,	O
proceed	O
using	O
standard	O
k-means	B-Algorithm
clustering	I-Algorithm
.	O
</s>
<s>
In	O
these	O
simulations	O
the	O
new	O
method	O
almost	O
always	O
performed	O
at	O
least	O
as	O
well	O
as	O
vanilla	B-General_Concept
-means	O
in	O
both	O
speed	O
and	O
error	O
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
vanilla	B-General_Concept
-means	O
,	O
which	O
can	O
generate	O
clusterings	O
arbitrarily	O
worse	O
than	O
the	O
optimum	O
.	O
</s>
<s>
The	O
k-means	B-Algorithm
++	I-Algorithm
approach	O
has	O
been	O
applied	O
since	O
its	O
initial	O
proposal	O
.	O
</s>
<s>
In	O
a	O
review	O
by	O
Shindler	O
,	O
which	O
includes	O
many	O
types	O
of	O
clustering	O
algorithms	O
,	O
the	O
method	O
is	O
said	O
to	O
successfully	O
overcome	O
some	O
of	O
the	O
problems	O
associated	O
with	O
other	O
ways	O
of	O
defining	O
initial	O
cluster-centres	O
for	O
k-means	B-Algorithm
clustering	I-Algorithm
.	O
</s>
<s>
report	O
an	O
application	O
of	O
k-means	B-Algorithm
++	I-Algorithm
to	O
create	O
geographical	O
cluster	O
of	O
photographs	O
based	O
on	O
the	O
latitude	O
and	O
longitude	O
information	O
attached	O
to	O
the	O
photos	O
.	O
</s>
<s>
Since	O
the	O
k-means	B-Algorithm
++	I-Algorithm
initialization	O
needs	O
k	O
passes	O
over	O
the	O
data	O
,	O
it	O
does	O
not	O
scale	O
very	O
well	O
to	O
large	O
data	O
sets	O
.	O
</s>
<s>
have	O
proposed	O
a	O
scalable	O
variant	O
of	O
k-means	B-Algorithm
++	I-Algorithm
called	O
k-means	B-Algorithm
||	O
which	O
provides	O
the	O
same	O
theoretical	O
guarantees	O
and	O
yet	O
is	O
highly	O
scalable	O
.	O
</s>
<s>
ELKI	B-Language
data-mining	B-Application
framework	O
contains	O
multiple	O
k-means	B-Algorithm
variations	O
,	O
including	O
k-means	B-Algorithm
++	I-Algorithm
for	O
seeding	O
.	O
</s>
<s>
MATLAB	B-Language
has	O
a	O
K-Means	B-Algorithm
implementation	O
that	O
uses	O
k-means	B-Algorithm
++	I-Algorithm
as	O
default	O
for	O
seeding	O
.	O
</s>
<s>
OpenCV	B-Language
includes	O
k-means	B-Algorithm
for	O
pixel	O
values	O
.	O
</s>
<s>
provides	O
K-Means	B-Algorithm
++	I-Algorithm
implementation	O
to	O
initialize	O
initial	O
centers	O
for	O
K-Means	B-Algorithm
,	O
X-Means	O
,	O
EMA	O
,	O
etc	O
.	O
</s>
<s>
scikit-learn	B-Application
has	O
a	O
K-Means	B-Algorithm
implementation	O
that	O
uses	O
k-means	B-Algorithm
++	I-Algorithm
by	O
default	O
.	O
</s>
<s>
Weka	B-Language
contains	O
k-means	B-Algorithm
(	O
with	O
optional	O
k-means	B-Algorithm
++	I-Algorithm
)	O
and	O
x-means	O
clustering	O
.	O
</s>
