Description Usage Arguments Details Value Author(s) See Also Examples
Computes all the pairwaise distances between the prototypes of a fitted Kernel 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 kernel space. This is useful in order to display those
prototypes via a nonlinear projection method such the Sammon mapping
(sammon
).
The distances are computed in the kernel space. If the kernel used to
fit the SOM is not positive, negative values may be obtained. When such
values are generated, they are replaced by NA
.
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
K <- as.kernelmatrix(tcrossprod(scale(iris[1:4])))
# a small hexagonal grid
sg <- somgrid(xdim=8,ydim=8,topo="hex")
# fit the SOM (random initialisation)
som <- batchsom(K,sg,init="random",method="cluster")
# 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.