Learn R Programming

FlowSOM (version 1.4.0)

Purity: Calculate mean weighted cluster purity

Description

Calculate mean weighted cluster purity

Usage

Purity(realClusters, predictedClusters, weighted = TRUE)

Arguments

realClusters
array with real cluster values
predictedClusters
array with predicted cluster values
weighted
logical. Should the mean be weighted depending on the number of poins in the predicted clusters

Value

Mean purity score, worst score, number of clusters with score < 0.75

Examples

Run this code
# Generate some random data as an example
realClusters <- sample(1:5,100,replace = TRUE)
predictedClusters <- sample(1:6, 100, replace = TRUE)

# Calculate the FMeasure
Purity(realClusters,predictedClusters)

Run the code above in your browser using DataLab