compactness: Compactness Measure

Description Usage Arguments Details Value Author(s) References Examples

View source: R/consensus_evaluate.R

Description

Compute the compactness validity index for a clustering result.

Usage

1

Arguments

data

a dataset with rows as observations, columns as variables

labels

a vector of cluster labels from a clustering result

Details

This index is agnostic to any reference clustering results, calculating cluster performance on the basis of compactness and separability. Smaller values indicate a better clustering structure.

Value

the compactness score

Author(s)

Derek Chiu

References

MATLAB function valid_compactness by Simon Garrett in LinkCluE

Examples

1
2
3
4
5
6
set.seed(1)
E <- matrix(rep(sample(1:4, 1000, replace = TRUE)), nrow = 100, byrow =
              FALSE)
set.seed(1)
dat <- as.data.frame(matrix(runif(1000, -10, 10), nrow = 100, byrow = FALSE))
compactness(dat, E[, 1])

Example output

[1] 24.13164

diceR documentation built on June 11, 2018, 5:04 p.m.