View source: R/measures_clusterings.R
mutual_info | R Documentation |
Computes the mutual information between two clusterings, such as a predicted and ground truth clustering.
mutual_info(true, pred, base = exp(1))
true |
ground truth clustering represented as a membership vector. Each entry corresponds to an element and the value identifies the assigned cluster. The specific values of the cluster identifiers are arbitrary. |
pred |
predicted clustering represented as a membership vector. |
base |
base of the logarithm. Defaults to |
Mutual information is an entropy-based measure of the similarity between two clusterings.
true <- c(1,1,1,2,2) # ground truth clustering
pred <- c(1,1,2,2,2) # predicted clustering
mutual_info(true, pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.