Description Usage Arguments Details Value Author(s) References See Also Examples
Plot self-organising map, obtained from function wccsom. Several types of plots are supported.
1 2 3 4 5 6 7 | ## S3 method for class 'wccsom'
plot(x, type = c("changes", "codes", "counts", "mapping",
"prediction", "property", "quality"),
classif = NULL, labels = NULL, pchs = NULL, main = NULL,
palette.name = heat.colors, ncolors, unit.colors,
unit.bgcol = NULL, zlim = NULL, property = NULL,
heatkey=TRUE, contin, ...)
|
x |
SOM object. |
type |
Type of plot. (Wow!) |
classif |
classification object, as returned by |
labels |
(optional) labels to plot when |
pchs |
(optional) plotting symbols to use when |
main |
title of the plot. |
palette.name |
colors to use as unit background for '"codes"', '"counts"', '"prediction"', '"property"' and '"quality"' plotting types. |
ncolors |
number of colors to use in the palette. |
unit.colors |
explicit definition of the colors for the units in the '"codes"', '"counts"', '"prediction"', '"property"' and '"quality"' plotting types. |
unit.bgcol |
background color for units if no other color information is to be plotted. For plotting type is '"codes"', the default is '"transparent"'; in other cases the default is '"gray"'. |
zlim |
Optional range for color coding of unit backgrounds. |
property |
Values to use if the '"property"' plotting type. Can be used for colouring units in general. |
heatkey |
Whether or not to generate a heatkey at the left side of the plot in the '"quality"', '"counts"', and '"property"' plotting types. |
contin |
Whether the heatkey should show a range of values (TRUE) or a series of discrete values. The function tries to make a good guess; in case of strange-looking results it may pay to explicitly provide a value for this argument. |
... |
Other graphical parameters, e.g. colours of labels in the '"mapping"' plotting type. |
Several different types of plots are supported:
Shows the mean change in similarity to the best matching codebook vector for each epoch. Since codebook vectors become more similar to the data that are mapped to them, the changes should always be positive. Upon convergence, the changes should be very small.
Shows the codebook vectors.
Shows the number of objects mapped to the individual units. Empty units are depicted in gray.
Show where a set of objects is mapped. It needs a '"labels"' argument: a string name for each object.
Shows predictions for units; if no '"property"' argument is given, the function will for supervised maps the predictions for every unit; for unsupervised maps, where this information is not available, it gives an error.
Plot a map with the units coloured according to a specific property. The standard application is to precompute the similarities of an object to all units in the map, and plot these with a colour key. Also other quantities may be used to colour the units: see the example of distances below.
Shows the units coloured according to the mean agreement (WCC) of mapped objects to the unit vector. A colour key is plotted on the left. The variation in the WCCs of the mapped objects is indicated by the blue line: if it is pointing downwards it indicates low variation, if pointing upwards large variation.
If type
equals '"property"', the wcc values for all units
are returned.
Ron Wehrens
R. Wehrens, W.J. Melssen, L.M.C. Buydens and R. de Gelder. Representing Structural Databases in a Self-Organising Map. Acta Cryst. B61, 548-557, 2005.
wccsom
, wccxyf
,
unit.distances
, predict.wccsom
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(cepha)
gr <- somgrid(3, 3, "hexagonal")
set.seed(7)
x <- wccsom(cepha$patterns, grid = gr, trwidth = 20, rlen = 100)
par(mfrow = c(3,2))
plot(x, type = "codes", main = "Codebook vectors")
plot(x, type = "changes", main = "Convergence")
plot(x, type = "counts", main = "Mapping counts")
plot(x, type = "quality", main = "Mapping quality")
plot(x, type = "mapping", main = "Mapping",
labels = cepha$class.names, col = as.integer(factor(cepha$class.names)))
plot(x, type = "mapping", main = "Mapping",
pchs = as.integer(factor(cepha$class.names)),
col = as.integer(factor(cepha$class.names)))
par(mfrow=c(1,1))
obj1.wccs <- wccmap(x, cepha$patterns[1,])
plot(x, type = "property", property = obj1.wccs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.