as.dist.relationalsom: 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 Relational Self-Organising Map (SOM).

Usage

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

Arguments

x

an object of class "relationalsom"

...

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

The distances are obtained via the relational formula which can lead to negative values. When such values are obtained, they are replaced by zeros and a warning is generated.

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 <- dist(scale(iris[1:4]))

# a small hexagonal grid
sg <- somgrid(xdim=8,ydim=8,topo="hex")

# fit the SOM (random initialisation)
som <- batchsom(data,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))

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