evaluateClustering {pipeComp} | R Documentation |
Evaluates a clustering using 'true' labels. Entries with missing true labels (i.e. NA) are excluded from calculations.
evaluateClustering(x, tl = NULL)
x |
The clustering labels |
tl |
The true labels |
A numeric vector of metrics (see the 'pipeComp_scRNA' vignette for details)
# 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)