som: Creation of a som object

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

Description

Create and initialize a som object.

Usage

1
som(formula, data, grid = grid(9, 9, type = "hexagonal"), neighborhood = "gaussian", weights.min = -1, weights.max = 1)

Arguments

formula

a formula object, no variables may appear on the left (response) side.

data

a data frame in which to interpret the variables named in the formula.

grid

a grid specifying the structure of the projection space.

neighborhood

a character, possible values are 'uniform' and 'gaussian'.

weights.min

numeric value, minimal value to used during the creation of the initial weights.

weights.max

numeric value, maximal value to used during the creation of the initial weights.

Details

Scale data to mean = 0 and std = 1 is recommanded. If the model contains factors, they will be transformed with the contr.treatment function.

Value

object of class {som}: a list with several components:

data

model.matrix of the model

withinss

within sums of squares for each row

weights

weights of the network

grid

argument {grid}

size

vector of length {nrow(weights)}. The ith value gives the number of data points in cluster i.

neighborhood

argument {neighborhood}

groups

vector of length {nrow(data)}. The ith value gives the cluster of the data points i

metagroups

vector of length {nrow(data)}. The ith value gives the meta-cluster of the data points i

Note

side effects Meta-groups are all equals to 1, the same meta-group. Warning NA values are not allowed.

Author(s)

David Gohel

References

Kohonen, T. (1995). Self-Organizing Maps

See Also

grid learn learnBatch plot.som summary.som predict.som biplot.som getWeights setWeights

Examples

1
2
3
4
5
6
7
8
9
library(MASS)
lcrabs <- log(crabs[, 4:8])

lcrabs.som <- som ( formula = ~ . , data = lcrabs
	, neighborhood = "uniform"
	, grid = grid ( xdim = 10 , ydim = 10 , type = "hexagonal" ) 
	, weights.min = min (lcrabs), weights.max = max (lcrabs)
	)
lcrabs.som

harrysouthworth/kohonen documentation built on May 17, 2019, 3:03 p.m.