getPurity {datautils} | R Documentation |
Gets the purity of a label vector wrt a ground truth (in the context of a clustering algorithm).
getPurity(truthLabels, inferLabels)
truthLabels |
ground truth labels, to which inferred labels are compared to compute the purity value |
inferLabels |
vector of inferred labels, which should have the same length as truthLabels |
purity value in [0,1]
Pierrick Bruneau
temp <- getPurity(c(1,1,1,2,1,5,3,4,5,3), c(2,2,2,3,1,1,3,4,2,3))