Description Usage Arguments Details Value Author(s) See Also Examples
Computes all the pairwaise distances between the prototypes of a fitted Self-Organising Map (SOM).
1 2 3 4 |
x |
an object of class |
... |
not used |
FUN |
not used |
Contrarily to the prototype.distances
function, those
methods compute all the pairwise distances between the prototypes of the
SOM in the original space. This is useful in order to display those
prototypes via a nonlinear projection method such the Sammon mapping
(sammon
).
as.matrix
returns a square matrix and as.dist
an object
of class "dist"
.
Fabrice Rossi
prototype.distances
for a quite different
approach based on path calculation in the prior structure.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(iris)
# scaling
data <- scale(iris[1:4])
# a small hexagonal grid
sg <- somgrid(xdim=8,ydim=8,topo="hex")
# fit the SOM
som <- batchsom(data,sg)
# display the prototypes via sammon mapping
library(MASS)
proto.sam <- sammon(as.dist(som))
plot(proto.sam$points)
# overlay the prior structure
lines(grid2lines(som,proto.sam$points))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.