learn: Train the network (Online algorithm).

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

Description

Perform the learning process of the network with online algorithm.

Usage

1
learn( object, number.iter, order, max.alpha = 0.5, min.alpha = 0.0, max.rayon = 3, min.rayon = 0, step.eval.si = 100 )

Arguments

object

a som object

number.iter

number of learning process' step. It won't have effect if order is specified.

order

vector of length number.iter, specifying which row is presented to the learning process at the n-ith step.

max.alpha

the maximum amount of change during learning process.

min.alpha

the minimum amount of change during learning process.

max.rayon

the maximum radius during learning process.

min.rayon

the minimum radii during learning process.

step.eval.si

integer. A vector will be created, it will have values of evenly spaced numbers from 1 to number.iter with spacing step.eval.si. At each value of the vector, an evaluation of energy function will be performed.

Details

Be carefull with step.eval.si, the smallest is the value, the longer it will take time to process. alpha decrease linearly from max.alpha to min.alpha over number.iter updates. rayon decrease linearly from max.rayon to min.rayon over number.iter updates.

Value

a som object.

Author(s)

David Gohel

References

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

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)
	)
# train the network
lcrabs.som <- learn( lcrabs.som , number.iter = 500 , max.alpha = 0.3, step.eval.si = 50)
# plot energy function and print a summary
plot( lcrabs.som , "energy")
summary( lcrabs.som )

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