cl_medoid(x, method = "euclidean")
cl_ensemble
).method
of function cl_dissimilarity
.d
for determining the medoid are obtained
by calling cl_dissimilarity
with arguments x
and
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
cl_consensus
## 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))
Run the code above in your browser using DataLab