View source: R/utils-evaluation.R
| compare_clusterings | R Documentation |
Clusters two dissimilarity matrices with the same linkage and number of clusters and reports their agreement (ARI, NMI, pairwise Jaccard) and the contingency table.
compare_clusterings(
D1,
D2,
NC = NULL,
linkage = "ward.D2",
labels = c("D1", "D2"),
verbose = TRUE
)
D1, D2 |
Square dissimilarity matrices over the same objects. |
NC |
Number of clusters (default |
linkage |
Linkage method. Default |
labels |
Length-2 labels for the two solutions. |
verbose |
Logical; print a short report. |
Invisibly, a list with the two label vectors, ARI,
NMI, pair_Jaccard and the contingency table.
set.seed(1)
D1 <- as.matrix(dist(matrix(rnorm(60), 20)))
D2 <- as.matrix(dist(matrix(rnorm(60), 20)))
compare_clusterings(D1, D2, NC = 3, verbose = FALSE)$ARI
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.