0

I'm working with the kohonen package (version 3.0.11) in R for applying the self-organising maps algorithm to a large data set.

In order to determine the optimal grid size, I tried to calculate both the quantisation error and the topographic error at various grid sizes, to see at which size their normalised sum is minimal. Unfortunately, whenever I run the topo.error() function, I get an error and I'm wondering if the function is still usable after version 2.0.19 of the package (that's the latest version for which I found documentation about the topo.error function).

I know other packages such as aweSOM have similar functions, but the kohonen::topo.error() function only uses the data set and grid parameters as arguments, and not the trained SOM model, saving a substantial amount of computation time.

Here is a minimal reproducible example with the output error:

Code

library('kohonen')
data(yeast)
set.seed(261122)
## take only complete cases
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)
## topographical error
topo.error(yeast.som, "bmu")

Output

Error in topo.error(yeast.som, "bmu") : 
  could not find function "topo.error"
Gianluca
  • 5
  • 2
  • The function was removed with Version 3.0.0: https://github.com/cran/kohonen/commit/f55147dbc00e909dd2d71d60e2931790055ce14d#diff-f7e68af0423caf401468742cdb01a2e5da925087ea54012e9ff7ad9df813cc14 You'll need to use an alternative package. – John Polo Nov 27 '22 at 02:32

0 Answers0