Learn R Programming

datautils (version 0.1.5)

getPurity:

Description

Gets the purity of a label vector wrt a ground truth (in the context of a clustering algorithm).

Usage

getPurity(truthLabels, inferLabels)

Arguments

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

Value

purity value in [0,1]

Examples

Run this code
temp <- getPurity(c(1,1,1,2,1,5,3,4,5,3), c(2,2,2,3,1,1,3,4,2,3))

Run the code above in your browser using DataLab