View source: R/measures_clusterings.R
contingency_table_clusters | R Documentation |
Compute the contingency table for a predicted clustering given a ground truth clustering.
contingency_table_clusters(true, pred)
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. |
Returns a table C
(stored as a sparse matrix) such that
C_{ij}
counts the number of elements assigned to
cluster i
in pred
and cluster j
in true
.
eval_report_clusters
computes common evaluation measures derived
from the output of this function.
true <- c(1,1,1,2,2) # ground truth clustering
pred <- c(1,1,2,2,2) # predicted clustering
contingency_table_clusters(true, pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.