ClusterIndex: Cluster index for cluster evaluation

Description Usage Arguments Details Value Author(s) Examples

Description

Function to evaluate clustering results by calculating the ratio between intra-cluster and inter-cluster distance

Usage

1
ClusterIndex(dist.obj, clusterVector)

Arguments

dist.obj

An object of class 'dist' for dataset

clusterVector

A vector with integers indicating which cluster observations belong to

Details

ClusterIndex computes the average distance for all observations, to observations in same cluster, and compare it with the average distance to observations in other clusters. The cluster index ranges from 0 to 1, where 0 indicates short distance to observations in same cluster, when compared to distance to observations on other clusters. 1 indicates equal distance to observations in same cluster as to observations in other clusters. The smaller the cluster index, the greater results are achieved with respect to intra- and inter-cluster distance. The theory is an extension of Tan, P.-N., Steinbach, M., Karpatne, A., & Kumar, V. (2005) idea of cohesion and separation

Value

avgDistCurrent

Average distance for all observations to other observations in same cluster

avgDistForeign

Average distance for all observations to other observations in other clusters

clusterindex

The ratio between avgDistCurrent and avgDistForeign, i.e. avgDistCurrent/avgDistForeign

Author(s)

Jacob H. Madsen

Examples

1
2
3
4
5
6
7
8
## Select a dataset to standardize and cluster
X <- scale(iris[,1:4])

## Cluster the dataset with a given number of clusters
cluster.obj <- kmeans(X, 3)

## Evaluate the clustering results with 'ClusterIndex'
ClusterIndex(dist(X), cluster.obj$cluster)

jhmadsen/ClustTools documentation built on May 24, 2019, 9:54 p.m.