Purity: Calculate mean weighted cluster purity

Description Usage Arguments Value Examples

View source: R/2_buildSOM.R

Description

Calculate mean weighted cluster purity

Usage

1
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

1
2
3
4
5
6
# 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)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

[1] 0.36 0.30 6.00

FlowSOM documentation built on Nov. 8, 2020, 6:40 p.m.