Learn R Programming

GrowingSOM (version 0.1.1)

train.gsom: Train a Growing Self-Organizing Map

Description

Computes a growing self-organizing map for mapping high-dimendional data to 2D.

Usage

train.gsom(data, spreadFactor=0.8, keepdata=FALSE, iterations=50, alpha=0.9, beta = 0.5, gridsize = FALSE, nhood= "rect", initrad = NULL, ...)

Arguments

data
a matrix or data.frame, with each row representing an observation and each column a dimension.
spreadFactor
the spread factor determines the rate with which new units are added to the map. Values close to 0 lead to few growth and therefore less nodes thatn values close to 1. The default value is 0.9.
keepdata
if set to TRUE, a copy of the traindata will be stored in the gsom object.
iterations
number of times that the dataframe will be presented to the network. (Growing and Smoothing Phase combined)
alpha
discount factor for the learning rate during the growing phase of the training. Values should be between 0 and 1.
beta
propagation rate. Determines the rate at which the error of a node, that cannot grow any nodes, is passed on to its neighbours. Suggested values may range between 0 and 1.
gridsize
default value is FALSE. If a nummeric value is entered, the grid-size of the network will be preditermined as a square with length of gridsize. No growth of the network will take place in this case.
nhood
define how the grid will be built, and how the neighbourhood will look like consequently. Allowed values are "rect" (rectangular) and "hex" (hexagonal).
initrad
if the gridsize is predetermined, the initial radius can be chosen here. If left blank, the square root of gridsize will be taken. A larger initrad can increase the quality of the clustering. However, the script can get very slow when a too large value is chosen. (number of necessary computations rises exponentially)
...
not used.

Value

an S3 object of class "gsom" with components:

Details

Euclidean distance is used in order to calculate the distances.

References

Damminda Alahakoon, Saman K. Halgamuge (2000): Dynamic Self-Organizing Maps with Controlled Growth for Knowledge Discovery. IEEE TRANSACTIONS ON NEURAL NETWORKS, VOL. 11.

See Also

train_xy.gsom, map.gsom, plot.gsom

Examples

Run this code

# load data
data(iris)
iris <- iris[,1:4]

# Train Gsom Model
gsom_iris <- train.gsom(iris)

# Some more Parameters
gsom_iris <- train.gsom(iris, spreadFactor=0.8, keepdata=TRUE, iterations=30, 
  alpha=0.5, gridsize = FALSE, nhood= "rect")

# Fixed Grid size
gsom_iris <- train.gsom(iris, iterations=30, gridsize = 10)

Run the code above in your browser using DataLab