<s>
Determining	B-Algorithm
the	I-Algorithm
number	I-Algorithm
of	I-Algorithm
clusters	I-Algorithm
in	I-Algorithm
a	I-Algorithm
data	I-Algorithm
set	I-Algorithm
,	O
a	O
quantity	O
often	O
labelled	O
k	O
as	O
in	O
the	O
k-means	B-Algorithm
algorithm	I-Algorithm
,	O
is	O
a	O
frequent	O
problem	O
in	O
data	B-Algorithm
clustering	I-Algorithm
,	O
and	O
is	O
a	O
distinct	O
issue	O
from	O
the	O
process	O
of	O
actually	O
solving	O
the	O
clustering	O
problem	O
.	O
</s>
<s>
For	O
a	O
certain	O
class	O
of	O
clustering	B-Algorithm
algorithms	I-Algorithm
(	O
in	O
particular	O
k-means	B-Algorithm
,	O
k-medoids	B-Algorithm
and	O
expectation	B-Algorithm
–	I-Algorithm
maximization	I-Algorithm
algorithm	I-Algorithm
)	O
,	O
there	O
is	O
a	O
parameter	O
commonly	O
referred	O
to	O
as	O
k	O
that	O
specifies	O
the	O
number	O
of	O
clusters	O
to	O
detect	O
.	O
</s>
<s>
Other	O
algorithms	O
such	O
as	O
DBSCAN	B-Algorithm
and	O
OPTICS	B-Algorithm
algorithm	I-Algorithm
do	O
not	O
require	O
the	O
specification	O
of	O
this	O
parameter	O
;	O
hierarchical	B-Algorithm
clustering	I-Algorithm
avoids	O
the	O
problem	O
altogether	O
.	O
</s>
<s>
The	O
correct	O
choice	O
of	O
k	O
is	O
often	O
ambiguous	O
,	O
with	O
interpretations	O
depending	O
on	O
the	O
shape	O
and	O
scale	O
of	O
the	O
distribution	O
of	O
points	O
in	O
a	O
data	B-General_Concept
set	I-General_Concept
and	O
the	O
desired	O
clustering	O
resolution	O
of	O
the	O
user	O
.	O
</s>
<s>
If	O
an	O
appropriate	O
value	O
of	O
k	O
is	O
not	O
apparent	O
from	O
prior	O
knowledge	O
of	O
the	O
properties	O
of	O
the	O
data	B-General_Concept
set	I-General_Concept
,	O
it	O
must	O
be	O
chosen	O
somehow	O
.	O
</s>
<s>
The	O
elbow	B-General_Concept
method	I-General_Concept
looks	O
at	O
the	O
percentage	O
of	O
explained	O
variance	O
as	O
a	O
function	O
of	O
the	O
number	O
of	O
clusters	O
:	O
</s>
<s>
In	O
most	O
datasets	B-General_Concept
,	O
this	O
"	O
elbow	O
"	O
is	O
ambiguous	O
,	O
making	O
this	O
method	O
subjective	O
and	O
unreliable	O
.	O
</s>
<s>
Percentage	O
of	O
variance	O
explained	O
is	O
the	O
ratio	O
of	O
the	O
between-group	O
variance	O
to	O
the	O
total	O
variance	O
,	O
also	O
known	O
as	O
an	O
F-test	B-General_Concept
.	O
</s>
<s>
While	O
the	O
idea	O
of	O
the	O
elbow	B-General_Concept
method	I-General_Concept
sounds	O
simple	O
and	O
straightforward	O
,	O
other	O
methods	O
(	O
as	O
detailed	O
below	O
)	O
give	O
better	O
results	O
.	O
</s>
<s>
In	O
statistics	O
and	O
data	B-Application
mining	I-Application
,	O
X-means	O
clustering	O
is	O
a	O
variation	O
of	O
k-means	B-Algorithm
clustering	I-Algorithm
that	O
refines	O
cluster	O
assignments	O
by	O
repeatedly	O
attempting	O
subdivision	O
,	O
and	O
keeping	O
the	O
best	O
resulting	O
splits	O
,	O
until	O
a	O
criterion	O
such	O
as	O
the	O
Akaike	O
information	O
criterion	O
(	O
AIC	O
)	O
or	O
Bayesian	B-General_Concept
information	I-General_Concept
criterion	I-General_Concept
(	O
BIC	B-General_Concept
)	O
is	O
reached	O
.	O
</s>
<s>
Another	O
set	O
of	O
methods	O
for	O
determining	O
the	O
number	O
of	O
clusters	O
are	O
information	O
criteria	O
,	O
such	O
as	O
the	O
Akaike	O
information	O
criterion	O
(	O
AIC	O
)	O
,	O
Bayesian	B-General_Concept
information	I-General_Concept
criterion	I-General_Concept
(	O
BIC	B-General_Concept
)	O
,	O
or	O
the	O
deviance	O
information	O
criterion	O
(	O
DIC	O
)	O
if	O
it	O
is	O
possible	O
to	O
make	O
a	O
likelihood	O
function	O
for	O
the	O
clustering	O
model	O
.	O
</s>
<s>
For	O
example	O
:	O
The	O
k-means	B-Algorithm
model	O
is	O
"	O
almost	O
"	O
a	O
Gaussian	O
mixture	O
model	O
and	O
one	O
can	O
construct	O
a	O
likelihood	O
for	O
the	O
Gaussian	O
mixture	O
model	O
and	O
thus	O
also	O
determine	O
information	O
criterion	O
values	O
.	O
</s>
<s>
Rate	B-General_Concept
distortion	I-General_Concept
theory	I-General_Concept
has	O
been	O
applied	O
to	O
choosing	O
k	O
called	O
the	O
"	O
jump	O
"	O
method	O
,	O
which	O
determines	O
the	O
number	O
of	O
clusters	O
that	O
maximizes	O
efficiency	O
while	O
minimizing	O
error	O
by	O
information-theoretic	O
standards	O
.	O
</s>
<s>
The	O
strategy	O
of	O
the	O
algorithm	O
is	O
to	O
generate	O
a	O
distortion	O
curve	O
for	O
the	O
input	O
data	O
by	O
running	O
a	O
standard	O
clustering	B-Algorithm
algorithm	I-Algorithm
such	O
as	O
k-means	B-Algorithm
for	O
all	O
values	O
of	O
k	O
between	O
1	O
and	O
n	O
,	O
and	O
computing	O
the	O
distortion	O
(	O
described	O
below	O
)	O
of	O
the	O
resulting	O
clustering	O
.	O
</s>
<s>
The	O
distortion	O
of	O
a	O
clustering	O
of	O
some	O
input	O
data	O
is	O
formally	O
defined	O
as	O
follows	O
:	O
Let	O
the	O
data	B-General_Concept
set	I-General_Concept
be	O
modeled	O
as	O
a	O
p-dimensional	O
random	O
variable	O
,	O
X	O
,	O
consisting	O
of	O
a	O
mixture	O
distribution	O
of	O
G	O
components	O
with	O
common	O
covariance	O
,	O
.	O
</s>
<s>
Because	O
the	O
minimization	O
over	O
all	O
possible	O
sets	O
of	O
cluster	O
centers	O
is	O
prohibitively	O
complex	O
,	O
the	O
distortion	O
is	O
computed	O
in	O
practice	O
by	O
generating	O
a	O
set	O
of	O
cluster	O
centers	O
using	O
a	O
standard	O
clustering	B-Algorithm
algorithm	I-Algorithm
and	O
computing	O
the	O
distortion	O
using	O
the	O
result	O
.	O
</s>
<s>
The	O
choice	O
of	O
the	O
transform	O
power	O
is	O
motivated	O
by	O
asymptotic	O
reasoning	O
using	O
results	O
from	O
rate	B-General_Concept
distortion	I-General_Concept
theory	I-General_Concept
.	O
</s>
<s>
Then	O
the	O
distortion	O
of	O
a	O
clustering	O
of	O
K	O
clusters	O
in	O
the	O
limit	B-Algorithm
as	O
p	O
goes	O
to	O
infinity	O
is	O
.	O
</s>
<s>
Intuitively	O
,	O
this	O
means	O
that	O
a	O
clustering	O
of	O
less	O
than	O
the	O
correct	O
number	O
of	O
clusters	O
is	O
unable	O
to	O
describe	O
asymptotically	O
high-dimensional	O
data	O
,	O
causing	O
the	O
distortion	O
to	O
increase	O
without	O
limit	B-Algorithm
.	O
</s>
<s>
If	O
,	O
as	O
described	O
above	O
,	O
K	O
is	O
made	O
an	O
increasing	O
function	O
of	O
p	O
,	O
namely	O
,	O
,	O
the	O
same	O
result	O
as	O
above	O
is	O
achieved	O
,	O
with	O
the	O
value	O
of	O
the	O
distortion	O
in	O
the	O
limit	B-Algorithm
as	O
p	O
goes	O
to	O
infinity	O
being	O
equal	O
to	O
.	O
</s>
<s>
Although	O
the	O
mathematical	O
support	O
for	O
the	O
method	O
is	O
given	O
in	O
terms	O
of	O
asymptotic	O
results	O
,	O
the	O
algorithm	O
has	O
been	O
empirically	O
verified	O
to	O
work	O
well	O
in	O
a	O
variety	O
of	O
data	B-General_Concept
sets	I-General_Concept
with	O
reasonable	O
dimensionality	O
.	O
</s>
<s>
The	O
broken	O
line	O
method	O
identifies	O
the	O
jump	O
point	O
in	O
the	O
graph	O
of	O
the	O
transformed	O
distortion	O
by	O
doing	O
a	O
simple	O
least	B-Algorithm
squares	I-Algorithm
error	O
line	O
fit	O
of	O
two	O
line	O
segments	O
,	O
which	O
in	O
theory	O
will	O
fall	O
along	O
the	O
x-axis	O
for	O
K	O
G	O
,	O
and	O
along	O
the	O
linearly	O
increasing	O
phase	O
of	O
the	O
transformed	O
distortion	O
plot	O
for	O
K	O
G	O
.	O
The	O
broken	O
line	O
method	O
is	O
more	O
robust	O
than	O
the	O
jump	O
method	O
in	O
that	O
its	O
decision	O
is	O
global	O
rather	O
than	O
local	O
,	O
but	O
it	O
also	O
relies	O
on	O
the	O
assumption	O
of	O
Gaussian	O
mixture	O
components	O
,	O
whereas	O
the	O
jump	O
method	O
is	O
fully	O
non-parametric	B-General_Concept
and	O
has	O
been	O
shown	O
to	O
be	O
viable	O
for	O
general	O
mixture	O
distributions	O
.	O
</s>
<s>
Optimization	O
techniques	O
such	O
as	O
genetic	B-Algorithm
algorithms	I-Algorithm
are	O
useful	O
in	O
determining	O
the	O
number	O
of	O
clusters	O
that	O
gives	O
rise	O
to	O
the	O
largest	O
silhouette	O
.	O
</s>
<s>
One	O
can	O
also	O
use	O
the	O
process	O
of	O
cross-validation	B-Application
to	O
analyze	O
the	O
number	O
of	O
clusters	O
.	O
</s>
<s>
Each	O
of	O
the	O
parts	O
is	O
then	O
set	O
aside	O
at	O
turn	O
as	O
a	O
test	O
set	O
,	O
a	O
clustering	O
model	O
computed	O
on	O
the	O
other	O
v−1	O
training	O
sets	O
,	O
and	O
the	O
value	O
of	O
the	O
objective	O
function	O
(	O
for	O
example	O
,	O
the	O
sum	O
of	O
the	O
squared	O
distances	O
to	O
the	O
centroids	O
for	O
k-means	B-Algorithm
)	O
calculated	O
for	O
the	O
test	O
set	O
.	O
</s>
<s>
Kernel	O
matrix	B-Architecture
defines	O
the	O
proximity	O
of	O
the	O
input	O
information	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
Gaussian	O
radial	B-Algorithm
basis	I-Algorithm
function	I-Algorithm
,	O
it	O
determines	O
the	O
dot	O
product	O
of	O
the	O
inputs	O
in	O
a	O
higher-dimensional	O
space	O
,	O
called	O
feature	O
space	O
.	O
</s>
<s>
The	O
kernel	O
matrix	B-Architecture
can	O
thus	O
be	O
analyzed	O
in	O
order	O
to	O
find	O
the	O
optimal	O
number	O
of	O
clusters	O
.	O
</s>
<s>
The	O
method	O
proceeds	O
by	O
the	O
eigenvalue	O
decomposition	O
of	O
the	O
kernel	O
matrix	B-Architecture
.	O
</s>
<s>
Finally	O
,	O
a	O
plot	O
will	O
be	O
drawn	O
,	O
where	O
the	O
elbow	O
of	O
that	O
plot	O
indicates	O
the	O
optimal	O
number	O
of	O
clusters	O
in	O
the	O
data	B-General_Concept
set	I-General_Concept
.	O
</s>
<s>
Robert	O
Tibshirani	O
,	O
Guenther	O
Walther	O
,	O
and	O
Trevor	O
Hastie	O
proposed	O
estimating	O
the	O
number	O
of	O
clusters	O
in	O
a	O
data	B-General_Concept
set	I-General_Concept
via	O
the	O
gap	O
statistic	O
.	O
</s>
<s>
The	O
gap	O
statistics	O
is	O
implemented	O
as	O
the	O
clusGap	O
function	O
in	O
the	O
cluster	O
package	O
in	O
R	B-Language
.	O
</s>
