| Title: | Cluster Validity Indices |
|---|---|
| Description: | Numerous indices to choose the optimal number of clusters when performing k-means. Relevant papers include: Tsagris M. and Kontemeniotis N. (2025). Lobachevskii Journal of Mathematics <doi:10.1134/S1995080225613700>. Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008) <doi:10.1214/07-AOS515>. |
| Authors: | Michail Tsagris [aut, cre], Nikolaos Kontemeniotis [aut] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-06-10 11:44:48 UTC |
| Source: | https://github.com/cran/clusterindices |
Numerous indices to choose the optimal number of clusters when performing k-means.
| Package: | clusterindices |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-06-05 |
| License: | GPL-2 |
Michail Tsagris <[email protected]>
Michail Tsagris [email protected] and Nikolaos Kontemeniotis [email protected].
Tsagris M. and Kontemeniotis N. (2025). Simplicial clustering using the –transformation.
Lobachevskii Journal of Mathematics, 46: 6471–6482.
https://arxiv.org/pdf/2509.05945.
Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008). A general trimming approach to robust cluster analysis. Annals of Statistics 36(3): 1324–1345.
–means algorithm with cluster indices computed
The –means algorithm with cluster indices computed.
cikmeans(y, ncl = 10, trim = 0, max.iters = 50, nstart = 10, all = FALSE)cikmeans(y, ncl = 10, trim = 0, max.iters = 50, nstart = 10, all = FALSE)
y |
A matrix with numerical data. |
ncl |
The maximum number of clusters to try. The minimum number of clusters is 2. |
trim |
A number in [0, 1). If trim = 0, then the classical |
max.iters |
The maximum number of iterations allowed during the |
nstart |
How many random starts to perform? |
all |
If this is TRUE, then the clustering indices of each observation for each number of clusters will be returned. |
The –means algorithm is performed and a series of cluster validity indices are computed.
A list inclusing:
min_crit |
A matrix with 9 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl. |
best_min |
The number of clusters selected based upon the minimal valued cluster validity indices. |
max_crit |
A matrix with 24 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl. |
best_max |
The number of clusters selected based upon the maximal valued cluster validity indices. |
cluster |
If the argument "all" is TRUE, then the clustering indices of each observation for each number of clusters will be returned in a matrix, where each column corresponds to the clustering of each number of clusters. |
Michail Tsagris and Nikolaos Kontemeniotis.
R implementation and documentation: Michail Tsagris [email protected] and Nikolaos Kontemeniotis [email protected].
Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008). A general trimming approach to robust cluster analysis. Annals of Statistics 36(3): 1324–1345.
clust.plot, index_min, index_max
y <- as.matrix(iris[, 1:4]) mod <- cikmeans(y, ncl = 5)y <- as.matrix(iris[, 1:4]) mod <- cikmeans(y, ncl = 5)
–means algorithm results
Visualization of the –means algorithm results.
clust.plot(y, mod)clust.plot(y, mod)
y |
A matrix with the data. |
mod |
The output of the kmeans() function. |
The function performs PCA and plots the data onto the first two dimensions, constructs the convex hull of the groups and plots them with different colours.
A plot.
Michail Tsagris and Nikolaos Kontemeniotis.
R implementation and documentation: Michail Tsagris [email protected] and Nikolaos Kontemeniotis [email protected].
Tsagris M. and Kontemeniotis N. (2025). Simplicial clustering using the –transformation.
Lobachevskii Journal of Mathematics, 46: 6471–6482.
https://arxiv.org/pdf/2509.05945.
Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008). A general trimming approach to robust cluster analysis. Annals of Statistics 36(3): 1324–1345.
y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) clust.plot(y, mod)y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) clust.plot(y, mod)
–means algorithm
Cluster indices (maximal valued) for the –means algorithm.
index_max(y, mod)index_max(y, mod)
y |
A matrix with numerical data. |
mod |
An object with the result of the |
A series of cluster validity indices (maximal valued) are computed.
A vector with 24 cluster validity indices.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) mod <- index_max(y, mod)y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) mod <- index_max(y, mod)
–means algorithm
Cluster indices (minimal valued) for the –means algorithm.
index_min(y, mod)index_min(y, mod)
y |
A matrix with numerical data. |
mod |
An object with the result of the |
A series of cluster validity indices (minimal valued) are computed.
A vector with 9 cluster validity indices.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) mod <- index_min(y, mod)y <- as.matrix(iris[, 1:4]) mod <- kmeans(y, 3) mod <- index_min(y, mod)