protoDist {SOMbrero}R Documentation

Compute distances between prototypes

Description

Compute distances, either between all prototypes (mode = "complete") or only between prototypes' neighbours (mode = "neighbors").

Usage

protoDist(object, mode = c("complete", "neighbors"), radius = 1, ...)

Arguments

object

a somRes object.

mode

Specifies which distances should be computed (default to "complete").

radius

Radius used to fetch the neighbors (default to 1). The distance used to compute the neighbors is the Euclidean distance.

...

Not used.

Details

When mode="complete", distances between all prototypes are computed. When mode="neighbors", distances are computed only between the prototypes and their neighbors. If the data were preprocessed during the SOM training procedure, the distances are computed on the normalized values of the prototypes.

Value

When mode = "complete", the function returns a square matrix which dimensions are equal to the product of the grid dimensions.

When mode = "neighbors", the function returns a list which length is equal to the product of the grid dimensions; the length of each item is equal to the number of neighbors. Neurons are considered to have 8 neighbors at most (i.e., two neurons are neighbors if they have an Euclidean distance smaller than radius. Natural choice for radius is 1 for hexagonal topology and 1 or \sqrt{2} for square topology (4 and 8 neighbors respectively).

Author(s)

Madalina Olteanu olteanu@ceremade.dauphine.fr
Nathalie Vialaneix nathalie.vialaneix@inrae.fr

See Also

trainSOM

Examples

set.seed(2343)
my.som <- trainSOM(x.data = iris[,1:4], dimension = c(5,5))
protoDist(my.som)

[Package SOMbrero version 1.4-2 Index]