Compute the medoid of an ensemble of partitions or hierarchies, i.e., the element of the ensemble minimizing the sum of dissimilarities to all other elements.
cl_medoid(x, method = "euclidean")
an ensemble of partitions or hierarchies, or something
coercible to that (see
a character string or a function, as for argument
Medoid clusterings are special cases of “consensus” clusterings characterized as the solutions of an optimization problem. See Gordon (2001) for more information.
d for determining the medoid are obtained
cl_dissimilarity with arguments
method. The medoid can then be found as the (first) row index
for which the row sum of
as.matrix(d) is minimal. Modulo
possible differences in the case of ties, this gives the same results
as (the medoid obtained by)
pam in package
The medoid partition or hierarchy.
A. D. Gordon (1999). Classification (2nd edition). Boca Raton, FL: Chapman & Hall/CRC.
1 2 3 4 5 6 7 8 9 10 11
## An ensemble of partitions. data("CKME") pens <- CKME[1 : 20] m1 <- cl_medoid(pens) diss <- cl_dissimilarity(pens) require("cluster") m2 <- pens[[pam(diss, 1)$medoids]] ## Agreement of medoid consensus partitions. cl_agreement(m1, m2) ## Or, more straightforwardly: table(cl_class_ids(m1), cl_class_ids(m2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.