The plot shows an hexagonal lattice representing the codebook vectors of the SOM. Inside each hexagon a pie chart is drawn, showing the relative percentage of pattern classes, mapped to this codebook vector. The size of each pie chart is adjusted according to the number of mapped patterns.
Several arguments allow customisation of size, scale and colouring of the plot.
The function needs two files of the SOM_PAK file set:
visual provides
the mapping of input patterns to the codebook vectors.
som.plot(visfile, datfile, ...)visual. visual is the
tool of SOM_PAK which maps pattern to the codebook vectors of
a self-organising map.\
The function reads files in the format created by visual.
som-plot only uses the last
colums of the file; i.e. the class information for each pattern.\
The function reads files in the format that is used by SOM_PAK.
rainbow()
vector of colour definitions
data frame with name of a class in column 1 and
colour definitions in column 2. If the number of defined colours is smaller then the number of classes
in the dataset, colours for the remaining classes are generated
by rainbow.
onlyDefCols default: FALSE; if TRUE, all undefined colours are replaced by white
edit.cols default: FALSE; if TRUE, a dialog box opens and allows editing of all color definitions
show.legend default: TRUE; defines if colour legend is displayed
legend.width default: 4; Width of legend
turn default: FALSE; swap X and Y axis
window.width default: NA; width of the window
window.height default: NA; height of the window
show.box default: TRUE; show frame around the plot
show.axis default: FALSE; show x and Y axis
scaleX default: NA; scale factor for X axis (overwrites new.xdim argument)
scaleY default: NA; scale factor for Y axis (overwrites new.ydim argument)
scale default: NA; scale factor for X and Y axis (overwrites other scale argument)
new.xdim default: NA; scale X axis to specified number of neurons
new.ydim default: NA; scale Y axis to specified number of neurons
show.counter.border default: 0.98 percentile as limit for the display of labels in the pie charts
som.plot(system.file("test.data/iris4som.out", package="somplot"),
system.file("test.data/iris4som.dat", package="somplot"))
Run the code above in your browser using DataLab