I'm generating a self-organizing map in R using the kohonen package. However, when looking at the documentation, I cannot find a clear understanding of what the codes
property of the som
object represents.
The documentation only states:
codes: a matrix of code vectors.
What is a matrix of code vectors in this context?
If it works like other SOM packages do, I believe the code value you mention refers to codebook vectors. Here's a good resource that explains how those work:
The codebook vectors themselves represent prototypes (points) within the domain, whereas the topological structure imposes an ordering between the vectors during the training process.
From http://www.cleveralgorithms.com/nature-inspired/neural/som.html
I would recommend reading the original paper that accompanied the kohnen package, which you can find here: https://www.jstatsoft.org/article/view/v021i05/v21i05.pdf
It provides quite a bit more detail than the R-docs.