plot.wccsom: Plot wccsom object

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Plot self-organising map, obtained from function wccsom. Several types of plots are supported.

Usage

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, ...)

Arguments

x

SOM object.

type

Type of plot. (Wow!)

classif

classification object, as returned by wccassign. Only needed if type equals '"mapping"', '"quality"', and '"counts"'. Also a vector of class numbers may be given. If the network was trained with keep.data equal to TRUE, then the object already contains this information.

labels

(optional) labels to plot when type equals '"mapping"'.

pchs

(optional) plotting symbols to use when type equals '"mapping"'.

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.

Details

Several different types of plots are supported:

'"changes"'

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.

'"codes"'

Shows the codebook vectors.

'"counts"'

Shows the number of objects mapped to the individual units. Empty units are depicted in gray.

'"mapping"'

Show where a set of objects is mapped. It needs a '"labels"' argument: a string name for each object.

'"prediction"'

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.

'"property"'

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.

'"quality"'

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.

Value

If type equals '"property"', the wcc values for all units are returned.

Author(s)

Ron Wehrens

References

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.

See Also

wccsom, wccxyf, unit.distances, predict.wccsom

Examples

 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)

wccsom documentation built on May 30, 2017, 12:52 a.m.

Related to plot.wccsom in wccsom...