grid2lines: Self-Organising Map grid

Description Usage Arguments Details Value Author(s) Examples

Description

Build a matrix that can be used to plot the direct neighbourhood relationship in the prior structure of a Self-Organising Map.

Usage

1
grid2lines(som,prototypes)

Arguments

som

an object of class "som"

prototypes

the coordinates of the objects to link in the result matrix (if missing, the coordinates of the prototypes of the som are used).

Details

grid2lines returns a transformed version of the coordinate matrix prototypes (or of the prototypes of a the fitted Self-Organising Map som). It can be used with, e.g., lines to draw edges between prototypes that are direct neighbours in the prior structure (NA values are inserted to prevent draw edges between unconnected prototypes).

Value

a matrix with the same number of columns as the original dataset used by the som object.

Author(s)

Fabrice Rossi

Examples

1
2
3
4
5
6
7
8
9
X <- cbind(rnorm(500),rnorm(500))

sg <- somgrid(xdim=7,ydim=7,topo="rect")

som <- batchsom(X,sg)

# display the data, the som's prototypes and the prior structure
plot(X,pch="+",col="red")
lines(grid2lines(som),type="b",pch=20)

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