Skip to contents

Determining the optimal number of cluster in the ACCA clustering using the average silhouette approach.

Usage

best_acca(m, ...)

# S3 method for class 'cmatrix'
best_acca(m, mink, maxk, maxrep = 2L, maxiter = 100L, ...)

# S3 method for class 'matrix'
best_acca(m, mink, maxk, maxrep = 2L, maxiter = 100L, ...)

Arguments

m

[matrix]
correlation matrix from corr_matrix.

...

Not used. Included for S3 method consistency.

mink

[integer(1)]
minimum number of clusters considered.

maxk

[integer(1)]
maximum number of clusters considered.

maxrep

[integer(1)]
Maximum number of consecutive iterations without changes in the cluster structure before stopping the algorithm. If the clusters remain identical for maxrep iterations in a row, the algorithm considers that it has converged and stops early, without reaching maxiter. It serves to speed up execution by detecting when the clustering has stabilized.

maxiter

[integer(1)]
Maximum number of iterations allowed for the algorithm. Regardless of cluster stability, the algorithm will be forcibly stopped after maxiter iterations to prevent infinite loops or excessive computation. It acts as a hard upper limit on the runtime.

Value

[list]
A list which is a list that has three elements:

  • silhouette.ave: The silhouettes average per k.

  • k: The sequence of clusters tested.

  • best.k: The optimal number of clusters.

References

Leonard Kaufman; Peter J. Rousseeuw (1990). Finding groups in data : An introduction to cluster analysis. Hoboken, NJ: Wiley-Interscience. p. 87. doi:10.1002/9780470316801. ISBN 9780471878766.

Starczewski, Artur, and Adam Krzyżak. "Performance evaluation of the silhouette index. "International Conference on Artificial Intelligence and Soft Computing. Springer, Cham, 2015.

See also

Author

Igor D.S. Siciliani, Paulo H. dos Santos

Examples


x <- corrp::corrp(iris)
m <- corrp::corr_matrix(x)
best_acca(m, 2, 6)
#> $silhouette.ave
#> [1]  0.1269651 -0.5036386 -0.1472888  0.0000000 -0.2543257
#> 
#> $k
#> [1] 2 3 4 5 6
#> 
#> $best.k
#> [1] 2
#>