I have a term document matrix (tdm) with 64 terms (row) and 1017 documents (columns). I want to use the self-organized-map to cluster the terms on 25 cells. In order to do that I have done:
somres <- som(as.matrix(tdm), grid=somgrid(ydim=5, xdim=5, 'hexagonal'))
- My target: I want to map every single term on the 25 cells to see how it varies on them.
- What I need: I'm looking for an object with 5x5 = 25 rows and 64 columns (or viceversa) in which I have 25 codebooks, and a vector with 64 values for each codebook (one for each term). I need it to map a single term on the 25 cells.
I cannot find it on the object somres (I have seen all the attributes on it). Do you have some ides before I change the package?
EDIT: the problem was simply in the fact that I used the "term document matrix" as input. If you use the "document term matrix" (package: koRpus) it works well. What I was looking for, in that case, is in