0
$\begingroup$

I've recently been using the aweSOM R package for cluster visualisation, https://cran.r-project.org/web/packages/aweSOM/vignettes/aweSOM.html.

In particular, the aweSOM package entails using partitioning around medoids (pam) on the SOM codebook, as demonstrated 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 using the codebook.

I would appreciate if anyone had suitable code to handle this problem.

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)

```
$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.