cluster analysis - Mapping data to an SOM in R -
i conducting data analysis on data in r. discovered self-organizing maps (som) , seems quite depict link among data. tried both "kohonen" , "som" libraries. however, not able map data onto created som. instance, here picture found in som tutorial data (here, countries) mapped onto som. can not figure out either how extract information different nodes som object created 1 of 2 libraries listed above.
does know how ?
edit:
some data , code example (using "kohonen" package):
library(kohonen) # wines = dataset kohonen library. has 76 examples 13 criteria. som_grid <- somgrid(xdim=5, ydim=5, topo="hexagonal") som_model <- som(wines, grid=som_grid) plot(som_model)
this code shows number of items in each node of som:
plot(som_model,type="counts",palette.name=coolbluehotred)
if want see value of first criteria nodes of som:
var <- 1 var_unscaled <- aggregate(as.numeric(wines[,var]),by=list(som_model$unit.classif),fun=mean,simplify=true)[,2] plot(som_model,type="property",property=var_unscaled,main=names(wines)[var])
i create map first image, meaning som name of each variable mapped closest node of som.
Comments
Post a Comment