<s>
The	O
-medoids	O
problem	O
is	O
a	O
clustering	B-Algorithm
problem	O
similar	O
to	O
-means	O
.	O
</s>
<s>
Both	O
the	O
-means	O
and	O
-medoids	O
algorithms	O
are	O
partitional	O
(	O
breaking	O
the	O
dataset	O
up	O
into	O
groups	O
)	O
and	O
attempt	O
to	O
minimize	O
the	O
distance	O
between	O
points	O
labeled	O
to	O
be	O
in	O
a	O
cluster	O
and	O
a	O
point	O
designated	O
as	O
the	O
center	O
of	O
that	O
cluster	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
-means	O
algorithm	O
,	O
-medoids	O
chooses	O
actual	O
data	O
points	O
as	O
centers	O
(	O
medoids	B-Algorithm
or	O
exemplars	O
)	O
,	O
and	O
thereby	O
allows	O
for	O
greater	O
interpretability	O
of	O
the	O
cluster	O
centers	O
than	O
in	O
-means	O
,	O
where	O
the	O
center	O
of	O
a	O
cluster	O
is	O
not	O
necessarily	O
one	O
of	O
the	O
input	O
data	O
points	O
(	O
it	O
is	O
the	O
average	O
between	O
the	O
points	O
in	O
the	O
cluster	O
)	O
.	O
</s>
<s>
Furthermore	O
,	O
-medoids	O
can	O
be	O
used	O
with	O
arbitrary	O
dissimilarity	O
measures	O
,	O
whereas	O
-means	O
generally	O
requires	O
Euclidean	O
distance	O
for	O
efficient	O
solutions	O
.	O
</s>
<s>
Because	O
-medoids	O
minimizes	O
a	O
sum	O
of	O
pairwise	O
dissimilarities	O
instead	O
of	O
a	O
sum	O
of	O
squared	O
Euclidean	O
distances	O
,	O
it	O
is	O
more	O
robust	O
to	O
noise	O
and	O
outliers	O
than	O
-means	O
.	O
</s>
<s>
-medoids	O
is	O
a	O
classical	O
partitioning	O
technique	O
of	O
clustering	B-Algorithm
that	O
splits	O
the	O
data	O
set	O
of	O
objects	O
into	O
clusters	O
,	O
where	O
the	O
number	O
of	O
clusters	O
assumed	O
known	O
a	O
priori	O
(	O
which	O
implies	O
that	O
the	O
programmer	O
must	O
specify	O
k	O
before	O
the	O
execution	O
of	O
a	O
-medoids	O
algorithm	O
)	O
.	O
</s>
<s>
The	O
medoid	B-Algorithm
of	O
a	O
cluster	O
is	O
defined	O
as	O
the	O
object	O
in	O
the	O
cluster	O
whose	O
average	O
dissimilarity	O
to	O
all	O
the	O
objects	O
in	O
the	O
cluster	O
is	O
minimal	O
,	O
that	O
is	O
,	O
it	O
is	O
a	O
most	O
centrally	O
located	O
point	O
in	O
the	O
cluster	O
.	O
</s>
<s>
In	O
general	O
,	O
the	O
-medoids	O
problem	O
is	O
NP-hard	O
to	O
solve	O
exactly	O
.	O
</s>
<s>
PAM	O
uses	O
a	O
greedy	B-Algorithm
search	I-Algorithm
which	O
may	O
not	O
find	O
the	O
optimum	O
solution	O
,	O
but	O
it	O
is	O
faster	O
than	O
exhaustive	O
search	O
.	O
</s>
<s>
Associate	O
each	O
data	O
point	O
to	O
the	O
closest	O
medoid	B-Algorithm
.	O
</s>
<s>
For	O
each	O
medoid	B-Algorithm
,	O
and	O
for	O
each	O
non-medoid	O
data	O
point	O
:	O
</s>
<s>
Algorithms	O
other	O
than	O
PAM	O
have	O
also	O
been	O
suggested	O
in	O
the	O
literature	O
,	O
including	O
the	O
following	O
Voronoi	B-Algorithm
iteration	I-Algorithm
method	O
known	O
as	O
the	O
"	O
Alternating	O
"	O
heuristic	O
in	O
literature	O
,	O
as	O
it	O
alternates	O
between	O
two	O
optimization	O
steps	O
:	O
</s>
<s>
k-means-style	O
Voronoi	B-Algorithm
iteration	I-Algorithm
tends	O
to	O
produce	O
worse	O
results	O
,	O
and	O
exhibit	O
"	O
erratic	O
behavior	O
"	O
.	O
</s>
<s>
Multiple	O
variants	O
of	O
hierarchical	B-Algorithm
clustering	I-Algorithm
with	O
a	O
"	O
medoid	B-Algorithm
linkage	O
"	O
have	O
been	O
proposed	O
.	O
</s>
<s>
The	O
Minimum	O
Sum	O
linkage	O
criterion	O
directly	O
uses	O
the	O
objective	O
of	O
medoids	B-Algorithm
,	O
but	O
the	O
Minimum	O
Sum	O
Increase	O
linkage	O
was	O
shown	O
to	O
produce	O
better	O
results	O
(	O
similar	O
to	O
how	O
Ward	O
linkage	O
uses	O
the	O
increase	O
in	O
squared	O
error	O
)	O
.	O
</s>
<s>
Earlier	O
approaches	O
simply	O
used	O
the	O
distance	O
of	O
the	O
cluster	O
medoids	B-Algorithm
of	O
the	O
previous	O
medoids	B-Algorithm
as	O
linkage	O
measure	O
,	O
but	O
which	O
tends	O
to	O
result	O
in	O
worse	O
solutions	O
,	O
as	O
the	O
distance	O
of	O
two	O
medoids	B-Algorithm
does	O
not	O
ensure	O
there	O
exists	O
a	O
good	O
medoid	B-Algorithm
for	O
the	O
combination	O
.	O
</s>
<s>
CLARANS	O
works	O
on	O
the	O
entire	O
data	O
set	O
,	O
but	O
only	O
explores	O
a	O
subset	O
of	O
the	O
possible	O
swaps	O
of	O
medoids	B-Algorithm
and	O
non-medoids	O
using	O
sampling	O
.	O
</s>
<s>
ELKI	B-Language
includes	O
several	O
k-medoid	B-Algorithm
variants	O
,	O
including	O
a	O
Voronoi-iteration	O
k-medoids	B-Algorithm
,	O
the	O
original	O
PAM	O
algorithm	O
,	O
Reynolds	O
 '	O
improvements	O
,	O
and	O
the	O
O(n² )	O
FastPAM	O
and	O
FasterPAM	O
algorithms	O
,	O
CLARA	O
,	O
CLARANS	O
,	O
FastCLARA	O
and	O
FastCLARANS	O
.	O
</s>
<s>
Julia	B-Application
contains	O
a	O
k-medoid	B-Algorithm
implementation	O
of	O
the	O
k-means	B-Algorithm
style	O
algorithm	O
(	O
fast	O
,	O
but	O
much	O
worse	O
result	O
quality	O
)	O
in	O
the	O
package	O
.	O
</s>
<s>
R	B-Language
contains	O
PAM	O
in	O
the	O
""	O
package	O
,	O
including	O
the	O
FasterPAM	O
improvements	O
via	O
the	O
options	O
variant	O
=	O
"	O
faster	O
"	O
and	O
medoids	B-Algorithm
=	O
"	O
random	O
"	O
.	O
</s>
<s>
RapidMiner	B-Algorithm
has	O
an	O
operator	O
named	O
KMedoids	O
,	O
but	O
it	O
does	O
not	O
implement	O
any	O
of	O
above	O
KMedoids	O
algorithms	O
.	O
</s>
<s>
Instead	O
,	O
it	O
is	O
a	O
k-means	B-Algorithm
variant	O
,	O
that	O
substitutes	O
the	O
mean	O
with	O
the	O
closest	O
data	O
point	O
(	O
which	O
is	O
not	O
the	O
medoid	B-Algorithm
)	O
,	O
which	O
combines	O
the	O
drawbacks	O
of	O
k-means	B-Algorithm
(	O
limited	O
to	O
coordinate	O
data	O
)	O
with	O
the	O
additional	O
cost	O
of	O
finding	O
the	O
nearest	O
point	O
to	O
the	O
mean	O
.	O
</s>
<s>
Rust	B-Application
has	O
a	O
""	O
crate	O
that	O
also	O
includes	O
the	O
FasterPAM	O
variant	O
.	O
</s>
<s>
MATLAB	B-Language
implements	O
PAM	O
,	O
CLARA	O
,	O
and	O
two	O
other	O
algorithms	O
to	O
solve	O
the	O
k-medoid	B-Algorithm
clustering	B-Algorithm
problem	O
.	O
</s>
