mapToUnit: Map additional data to a Self-Organising Map

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

Description

mapToUnit is used to map additional data to a fitted Self-Organising Map. The main use case is the mapping of variables that were not used during the fitting (e.g., factors).

Usage

1
mapToUnit(som, values)

Arguments

som

an object of class "som"

values

a matrix or a data frame of observations to map on to the SOM's unit. The number of observations must be equal to the number of observations used to fit the SOM

Details

The goal of this function is not to assign new observations to a fitted SOM but rather to map additional variables (see predict.somnum for new observations assignment). The mapping is based only on the clustering result of the SOM: if observation number k was assigned to unit l at the end of the fitting process, then values[k,] is mapped to the l-th component of the resulting list.

Value

a list of length the number of units in the SOM. Each component contains the subset of values that is mapped to the corresponding unit.

Author(s)

Fabrice Rossi

See Also

predict.somnum for new observations assignment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(iris)
# scaling
data <- scale(iris[1:4])

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

# fit the SOM
som <- batchsom(data,sg)

# map the class information and print the content of each cell
print(mapToUnit(som,iris[[5]]))

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