I want to count quantization error (qe) in my SOM model using R. This is the code I've tried:
data(yeast)## take only complete
x <- yeast[[3]][apply(yeast[[3]], 1, function(x) sum(is.na(x))) == 0,]
yeast.som <- som(x, somgrid(5, 8, "hexagonal"))
## quantization error:
mean(yeast.som$distances)
Is that code right? There exist another method to count qe?