Hi All,
I've recently been using the aweSOM R package for cluster visualisation, aweSOM.
One cluster method within the aweSOM package entails using partitioning around medoids (pam) on the SOM codebook. This is demonstrate below.
However, one limitation of the aweSOM package is that it only allows for two cluster validation measures: "silhouette" and "elbow."
Therefore, I wondered if someone was aware of how to generate other validation statistics (Dunn, Davies-Bouldin etc) using the output of pam clustering on the codebook?
I've currently tried packages 'fpc' and 'clvalid' but ran into some problems. Would appreciate if anyone had any direction.
Thanks
library(aweSOM)
library(kohonen)
library(RColorBrewer)
library(cluster)
full.data <- iris
train.data <- full.data[, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")]
train.data <- scale(train.data)
set.seed(1465)
init <- somInit(train.data, 4, 4)
iris.som <- kohonen::som(train.data, grid = kohonen::somgrid(4, 4, "hexagonal"),
rlen = 100, alpha = c(0.05, 0.01), radius =
c(2.65,-2.65),
dist.fcts = "sumofsquares", init = init)
#####
#PAM CLUSTERING
#####
superclust_pam <- cluster::pam(iris.som$codes[[1]], 3)
superclasses_pam <- superclust_pam$clustering
#####
#VALIDATION METHODS
#####
aweSOMscreeplot(som = iris.som, method = "pam", nclass = 3)
aweSOMsilhouette(iris.som, superclasses_pam)