ClusterDBCV: Density-Based Clustering Validation

View source: R/ClusterDBCV.R

ClusterDBCVR Documentation

Density-Based Clustering Validation

Description

Density-Based Clustering Validation [Moulavi et al., 2014] evaluates a hard partition without a reference classification. Density-based validity in [-1,1]; larger values are better.

Usage

ClusterDBCV(Cls, DataOrDistances, Dimension = NULL,
                       DistanceMethod = "euclidean", Silent = TRUE, ...)

Arguments

Cls

Vector of length n containing arbitrary numeric, character, or factor cluster labels. Missing labels and non-finite numeric labels are not allowed. Rows and labels are matched by position. Label 0 (including character or factor level "0") denotes noise.

DataOrDistances

Finite numeric data matrix or data frame with n rows, a symmetric n by n dissimilarity matrix with non-negative entries and a zero diagonal, or a dist object. Matrices are recognized as dissimilarities by IsDissimilarity. A square raw-data matrix satisfying that test is therefore interpreted as distances. Each unordered pair is counted once, without self-pairs.

Dimension

Positive integer giving the original feature-space dimension for DBCV. Required for precomputed dissimilarities. With feature data, NULL uses the number of columns; an explicit value must match it. Constant columns are not removed automatically.

DistanceMethod

Distance method for feature data, passed to parallelDist::parDist() or stats::dist() if parallelDist is unavailable. Ignored for precomputed dissimilarities. Default: "euclidean". DBCV's density interpretation assumes a distance and dimension appropriate to the original feature space, normally Euclidean.

Silent

Logical scalar. Suppresses the progress message for distance calculation when TRUE; warnings and missing-package messages remain.

...

Further arguments for parallelDist::parDist() or its stats::dist() fallback. Ignored for precomputed dissimilarities.

Details

ClusterDBCV implements all-points core distances with exponent Dimension, mutual-reachability minimum spanning trees (MSTs), density sparseness, and density separation. The core distance of a point in a cluster of size s is

\left(\frac{1}{s-1}\sum_{j \ne i} d(i,j)^{-D}\right)^{-1/D}.

Duplicate points give core distance zero. Mutual reachability is the maximum of the ordinary distance and the two core distances. Internal nodes have MST degree greater than one. Density sparseness is the largest edge between internal nodes; following the convention used by dbscan::dbcv, the largest MST edge is used if there is no internal edge. Density separation is the smallest mutual-reachability distance between internal nodes of different clusters. Per-cluster validity is (nearest separation - sparseness) divided by their maximum. The total score weights each validity by cluster size / n, where n includes noise. Clusters with fewer than three observations are treated as noise because they cannot have internal nodes; at least two retained clusters are required. Values lie in [-1,1] when defined. The calculation uses all observations without random subsampling and has quadratic distance storage. Prim's MST algorithm breaks ties by first index; ties can admit different MSTs and consequently different internal nodes. This function computes its own core distances, MSTs and separation and does not require dbscan.

Malformed inputs cause an error. Fewer than two retained clusters or undefined density ratios produce a warning and return NaN.

Pairwise distance storage is quadratic in the number of observations. No observations are subsampled.

Value

List of

DBCV

Density-based validity in [-1,1]; larger values are better.

Object

List of ClusterLabels, ClusterSizes, Dimension, DensitySparseness, DensitySeparation, ClusterValidity, CoreDistances, InternalNodes, MST and NoiseCount. Cluster-level components follow ClusterLabels; node numbers refer to original input rows. Core distances for noise are NA. Invalid partitions return NULL.

Author(s)

Michael Thrun

References

[Moulavi et al., 2014] Moulavi, D., Jaskowiak, P. A., Campello, R. J. G. B., Zimek, A., & Sander, J.: Density-Based Clustering Validation, Proceedings of the 2014 SIAM International Conference on Data Mining, pp. 839-847, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1137/1.9781611973440.96")}, 2014.

See Also

ClusterNoEstimation, ClusterDunnIndex, ClusterDaviesBouldinIndex

Examples

Data = matrix(c(0, 1, 2, 10, 11, 12), ncol = 1)
Cls = rep(c(10, 20), each = 3)
V = ClusterDBCV(Cls, Data)
V$DBCV

Distances = stats::dist(Data)
V = ClusterDBCV(Cls, Distances, Dimension = ncol(Data))
V$DBCV

FCPS documentation built on Nov. 28, 2026, 9:08 a.m.