cl_dissimilarity(x, y = NULL, method = "euclidean")
cl_ensemble
).NULL
(default), or as for x
.y
is NULL
, an object of class
"cl_dissimilarity"
containing the dissimilarities between all
pairs of components of x
. Otherwise, an object of class
"cl_cross_dissimilarity"
with the dissimilarities between the
components of x
and the components of y
.y
is given, its components must be of the same kind as those
of x
(i.e., components must either all be partitions, or all be
hierarchies).If all components are partitions, the following built-in methods for measuring dissimilarity between two partitions with respective membership matrices $u$ and $v$ (brought to a common number of columns) are available:
[object Object],[object Object]
If all components are hierarchies, available built-in methods for measuring agreement between two hierarchies with respective ultrametrics $u$ and $v$ are as follows.
[object Object],[object Object],[object Object]
If a user-defined agreement method is to be employed, it must be a function taking two clusterings as its arguments.
Symmetric dissimilarity objects of class "cl_dissimilarity"
are
implemented as symmetric proximity objects with self-proximities
identical to zero, and inherit from class "cl_proximity"
. They
can be coerced to dense square matrices using as.matrix
. It
is possible to use 2-index matrix-style subscripting for such objects;
unless this uses identical row and column indices, this results in a
(non-symmetric dissimilarity) object of class
"cl_cross_dissimilarity"
.
Symmetric dissimilarity objects also inherit from class
"dist"
(although they currently do not
cl_agreement
## An ensemble of partitions.
data("CKME")
pens <- CKME[1 : 30]
diss <- cl_dissimilarity(pens)
summary(c(diss))
cl_dissimilarity(pens[1:5], pens[6:7])
## Equivalently, using subscripting.
diss[1:5, 6:7]
## Can use the dissimilarities for "secondary" clustering
## (e.g. obtaining hierarchies of partitions):
hc <- hclust(diss)
plot(hc)
Run the code above in your browser using DataLab