Closed schochastics closed 6 years ago
@xgdgsc, any thoughts?
Would changing the first few lines to:
nSomX = nrow(result$uMatrix)
nSomY = ncol(result$uMatrix)
grid = somgrid(nSomX, nSomY)
mapping <- map(som(result$codebook, grid=grid), newdata = input_data)
do?
Will give it a try and report back. Thx Edit: seems to work
I have found a strange behavior when invoking
Rsomoclu.kohonen()
. It appears that the input data is only mapped to the first 48 SOM nodes. I dug into the code and found that the problem appears in the linemapping <- map(som(result$codebook), newdata = input_data)
.kohonen::som
callskohonen::somgrid()
and initializes a 8x6 grid, so the input data is just mapped to this grid even if the grid constructed inRsomoclu.train()
is larger. For my purposes I wrote a very crued workaround that appears to work (only for distance function "sumofsquares" and slow for large input data!)