evaluateClustering: evaluateClustering

Description Usage Arguments Value Examples

View source: R/scrna_evaluationFunctions.R

Description

Evaluates a clustering using 'true' labels. Entries with missing true labels (i.e. NA) are excluded from calculations. If using 'evaluteClustering' in a custom pipeline, you might want to use the corresponding 'pipeComp:::.aggregateClusterEvaluation' aggregation function.

Usage

1

Arguments

x

The clustering labels

tl

The true labels

Value

A numeric vector of metrics (see the 'pipeComp_scRNA' vignette for details)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# random data
dat <- data.frame( 
 cluster=rep(LETTERS[1:3], each=10),
 x=c(rnorm(20, 0), rnorm(10, 1)),
 y=c(rnorm(10, 1), rnorm(20, 0))
)
# clustering
dat$predicted <- kmeans(dist(dat[,-1]),3)$cluster
# evaluation
evaluateClustering(dat$predicted, dat$cluster)

plger/pipeComp documentation built on Nov. 2, 2021, 8:40 p.m.