View source: R/ClusterDunnIndex.R
| ClusterDunnIndex | R Documentation |
Calculates the internal Dunn cluster-validity index for a given clustering [Dunn, 1974]. No prior classification is required.
ClusterDunnIndex(Cls,DataOrDistances,
DistanceMethod="euclidean",Silent=TRUE,Force=FALSE,...)
Cls |
A numerical vector of length n defining the classification. It has k unique values representing the arbitrary cluster labels. |
DataOrDistances |
Either a [1:n,1:d] data matrix containing n observations
and d variables, or a symmetric [1:n,1:n] dissimilarity matrix. For a data
matrix, pairwise distances are calculated using |
DistanceMethod |
Optional distance method passed to
|
Silent |
Logical scalar. If |
Force |
Logical scalar. If |
... |
Further arguments passed to |
The Dunn index is defined as
min(InterDist) / max(IntraDist). Well-separated clusters usually have a
Dunn index above 1; see [Dunn, 1974] for details.
A list with the following components:
Dunn |
A numeric scalar containing the Dunn index. |
IntraDist |
A numerical vector of length k containing the maximum within-cluster distance for each cluster. |
InterDist |
A numerical vector of length k containing the minimum between-cluster distance for each cluster. |
Michael Thrun
[Dunn, 1974] Dunn, J. C.: Well-separated clusters and optimal fuzzy partitions. Journal of Cybernetics, Vol. 4(1), pp. 95-104, 1974.
data("Hepta")
Cls <- kmeansClustering(
Hepta$Data,
ClusterNo = 7,
Type = "Hartigan"
)$Cls
ClusterDunnIndex(Cls, Hepta$Data)
ClsWellSeparated <- kmeansClustering(
Hepta$Data,
ClusterNo = 7,
Type = "Steinley"
)$Cls
ClusterDunnIndex(ClsWellSeparated, Hepta$Data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.