Purity: Calculate mean weighted cluster purity

View source: R/2_buildSOM.R

PurityR Documentation

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 points in the predicted clusters

Value

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

Examples

# 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)

SofieVG/FlowSOM documentation built on Feb. 1, 2024, 11:33 a.m.