Description Usage Arguments Details Value Author(s) References See Also Examples
Build a regularly sampled surface that represents the distances between prototypes of a fitted Self-Organising Map that are direct neighbours in the prior structure. The surface is generated via the U-matrix principle.
1 | distance.grid(sompdist, mode = c("mean", "full"), nxo, nyo,outer=FALSE)
|
sompdist |
an object of class |
mode |
specifies what distances are taken into account to generate the surface (see Details) |
nxo |
horizontal resolution of the generated surface |
nyo |
vertical resolution of the generated surface |
outer |
specifies whether generated surface is slightly extended by extrapolation outside of the boundaries of the prior structure or not (the default case) |
There are two modes for generating the surface, "mean"
and
"full"
. In the "mean"
mode, the function first computes
the mean distance between each prototype and all of its neighbours in
the prior structure. Each value is associated to the position of the
prototype in the two dimensional prior structure. In the
"full"
mode, individual distances between neighbouring prototypes
are used. Each value is associated to the middle of the segment that
links the positions of corresponding prototypes in the prior
structure.
Both prior topologies need some specific rules:
"rectangular"
expect for those on the border, each prototype has eight neighbours. Segments linking diagonal neighbours of horizontal or vertical neighbours intersect in their middle. As a consequence, each corresponding intersection is used by two prototype pairs: the associated value is the mean of the distances between the involved prototypes. In other terms, only horizontal and vertical neighbours have exact distances mapped on the surface.
"hexagonal"
hexagonal prior structures are not grids. The function must therefore interpolate the exact surface to evaluate it on a regular grid.
When nxo
and/or nyo
is specified, the function first
computes the original surface and then generates an interpolated surface
that is evaluated on a regular grid with nxo
vertical lines
and nyo
horizontal lines (when one of the value is missing, it is
generated from the underlying somgrid
). The interpolation method
is based on Radial Basis Function and on a decomposition of the point
set to avoid inverting large linear system. This a simplified version
of the algorithm given in the Pouderoux et al. article cited in the
References section.
The result of the function uses the conventions of standard surface
plotting functions such as persp
, contour
,
filled.contour
, etc.
a list with components
x |
locations of vertical lines of the grid |
y |
locations of horizontal lines of the grid |
z |
the value of the surface at the nodes of the grid |
Fabrice Rossi
Ultsch, A. and Siemon, H. P. (1990) Kohonen's self organizing feature maps for exploratory data analysis, in: Proceedings of International Neural Network Conference (INNC'90).
Pouderoux, J., Tobor, I., Gonzato, J.C. and Guitton, P. (2004) Adaptive hierarchical RBF interpolation for creating smooth digital elevation models, in: Proceedings of the Twelfth ACM International Symposium on Advances in Geographical Information System 2004, page 232–240.
See prototype.distances
for computing the
distances. See plot.sompdist
and umatrix
for a simpler visualisation of the same data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(iris)
# scaling
data <- scale(iris[1:4])
# a large hexagonal grid
sg <- somgrid(xdim=15,ydim=15,topo="hex")
# fit the SOM
som <- batchsom(data,sg)
# compute prototype distances
pdist <- prototype.distances(som)
# display them via interpolation
pdist.grid <- distance.grid(pdist,mode="mean",nxo=30,nyo=30)
# and contour lines
filled.contour(pdist.grid)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.