Description Usage Arguments Details Value Examples
For two clusterings of the same data set, this function calculates the similarity statistic specified of the clusterings from the comemberships of the observations. Basically, the comembership is defined as the pairs of observations that are clustered together.
1 | cluster_similarity(labels1, labels2, similarity = "adjusted_rand")
|
labels1 |
a vector of |
labels2 |
a vector of |
similarity |
the similarity statistic to calculate. See
|
To calculate the similarity, we compute the 2x2 contingency table, consisting of the following four cells:
the number of observation pairs where both observations are comembers in both clusterings
the number of observation pairs where the observations are comembers in the first clustering but not the second
the number of observation pairs where the observations are comembers in the second clustering but not the first
the number of observation pairs where neither pair are comembers in either clustering
Currently, we have implemented the following similarity statistics:
Adjusted Rand index
Dice coefficient
Fowlkes-Mallows coefficient
Jaccard coefficient
Phi coefficient
Rand index
Rogers-Tanimoto coefficient
Russel-Rao coefficient
Sokal-Sneath coefficient
To compute the contingency table, we use the comembership_table
function.
the similarity between the two clusterings
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.