Description Usage Arguments Details Author(s) References See Also Examples
Plot a glyph based rendering of data associated to each cell of the prior structure of a Self-Organising Map. Each glyph is positioned thanks to the prior structure.
1 2 3 4 |
x |
an object of class |
y |
a matrix or a data frame of data associated to the som's prototypes |
mode |
the mode of the display, either |
type |
the type of the plot, chosen from |
with.grid |
logical, with default to |
barplot.align |
specifies the alignment used for the barplots
when |
global.scale |
logical, with default to |
... |
additional parameters transmitted to the low level plot function (see details) |
This function uses the prior structure of a fitted SOM to arrange some
glyphs on a screen, either a single glyph per cell (when
mode="prototype"
) or an arbitrary number of glyphs per cell,
including zero (when mode="data"
). The primary usage of this
function is to display either to the prototypes of a fitted SOM or to
display the data points associated to each cluster.
The glyph calculation depends on the mode
parameter as follows:
mode="prototype"
In this case, one glyph is computed
per cell in the prior structure. When y
is missing, the glyph
corresponds to the prototype associated to the corresponding
cluster. In this situation, the function is restricted to numerical
SOMs (as obtained with batchsom.default
). When y
is specified, it must be a matrix
or a data.frame
with
numerical content. Each row of y
is used to compute a glyph.
mode="data"
In this case, an arbitrary number of glyphs is
associated to each cell. When y
is missing, a glyph is computed
for each original data point assigned to the corresponding
cluster/cell. As in the previous case, the function is restricted to
numerical SOMs. When y
is specified, it must be a list
with length equal to the number of cells in the prior structure (for
instance, the result of mapToUnit
). The
list must be homogeneous and is restricted to two types of
content. The first type corresponds to matrix/data.frame: all
matrices/data.frames must have the same number of columns and each row
defines a glyph. The second type corresponds to factors: each cell of
y
must be a factor defined on an unique and common set of levels.
The actual glyphs depend on the type
parameter:
type="parallel"
this corresponds to a parallel coordinate like representation: each prototype is considered as a function mapping its coordinate index to the associated value. Functions are displayed as lines.
type="stars"
in this case, the function uses
stars
to draw a star plot for each
prototype, at the corresponding position in the prior structure
type="barplot"
this representation uses a barplot for each
prototype. When barplot.align="bottom"
(the default value),
the prototypes coordinates are scaled to [0,1] while they
are scaled to [-1,1] when
barplot.align="center"
. In both cases, the baseline line of the
barplots is at 0 which gives two different types of visualisation. In
the case of mode="data"
, bar plots are restricted to the factor
valued case for y
.
Additional parameters can be transmitted to the underlying low level
drawing functions. Parameters prefixed by grid.
are used for
the grid plotting when with.grid=TRUE
(see
plot.somgrid
).
Fabrice Rossi
Vesanto, J. (2002) Data Exploration Process Based on the Self–Organizing Map, PhD thesis, Helsinki University of Technology, Espoo (Finland), Acta Polytechnica Scandinavica, Mathematics and Computing Series No. 115.
See mapToUnit
for building y
when mode="data"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(iris)
# scaling
data <- scale(iris[1:4])
# a small hexagonal grid
sg <- somgrid(xdim=7,ydim=7,topo="hex")
# fit the SOM
som <- batchsom(data,sg)
# and display the prototypes as parallel coordinates
plot(som)
# display the prototypes as star plots, with a red grid
plot(som,type="stars",with.grid=TRUE,grid.border="red")
# display all the data as parallel coordinates
plot(som,mode="data",with.grid=TRUE)
# display an additional factor variable with a barplot
plot(som,mapToUnit(som,iris[[5]]),mode="data",type="barplot")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.