Learn R Programming

DBCVindex (version 1.1)

dbcv: Function that calculates the Density-Based Clustering Validation index (DBCV) of clustering results

Description

Function that calculates the Density-Based Clustering Validation index (DBCV) of clustering results

Usage

dbcv(data, labels, metric = "euclidean", noise_id = -1)

Value

a real value containing the Saturn coefficient

Arguments

data

input clustering results

labels

labels of the clustering

metric

metric of the distance, Euclidean by default

noise_id

the code of the noise cluster points, -1 by default

Examples

Run this code

n = 300; noise = 0.05; seed = 1782;
theta <- seq(0, pi, length.out = n / 2)
 x1 <- cos(theta) + rnorm(n / 2, sd = noise)
 y1 <- sin(theta) + rnorm(n / 2, sd = noise)
 x2 <- cos(theta + pi) + rnorm(n / 2, sd = noise)
 y2 <- sin(theta + pi) + rnorm(n / 2, sd = noise)
 X <- rbind(cbind(x1, y1), cbind(x2, y2))
 y <- c(rep(0, n / 2), rep(1, n / 2))

cat("dbcv(X, y) = ", dbcv(X, y), "\n", sep="")

Run the code above in your browser using DataLab