as.dist.somnum: Compute all the distances between prototypes in a fitted...

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

Description

Computes all the pairwaise distances between the prototypes of a fitted Self-Organising Map (SOM).

Usage

1
2
3
4
## S3 method for class 'somnum'
as.dist(x, FUN = NULL)
## S3 method for class 'somnum'
as.matrix(x, ...)

Arguments

x

an object of class "somnum"

...

not used

FUN

not used

Details

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

Value

as.matrix returns a square matrix and as.dist an object of class "dist".

Author(s)

Fabrice Rossi

See Also

prototype.distances for a quite different approach based on path calculation in the prior structure.

Examples

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

yasomi documentation built on May 2, 2019, 5:59 p.m.