kmeans_clustersRProg {SOMEnv} | R Documentation |
K-means algorithm applied for different values of clusters
Description
The som_kmeansR function with 100 epochs training is run for a custom number of times for each k value of clusters and the best of these is selected based on sum of squared errors (err). The Davies-Bouldin index is calculated for each k-clustering. The function has been coded in R code starting from kmeans_clusters.m script present in somtoolbox for Matlab by Vesanto and adapted to show a progress bar when working embedded in the shiny app.
Usage
kmeans_clustersRProg(codebook, k = 5, times = 5, seed = NULL)
Arguments
codebook |
SOM codebook |
k |
Maximum number of clusters (the function will be run from 2 to k clusters) |
times |
Number of times the som_kmeansR function is iterated |
seed |
Number for set.seed function |
Value
This function returns a list containing the cluster number assignment for each sample, the cluster centroids, the total quantization error, the DB-index for each number of clusters, and the random seed number used
Author(s)
Sabina Licen, Pierluigi Barbieri
References
J. Vesanto, J. Himberg, E. Alhoniemi, J. Parhankagas, SOM Toolbox for Matlab 5, Report A57, 2000, Available at: www.cis.hut.fi/projects/somtoolbox/package/papers/techrep.pdf
See Also
som_mdistR, som_kmeansRProg, db_indexR