Self Organising Maps

The self-organising map (SOM) is a method for unsupervised learning, based on a grid of artificial neurons whose weights are adapted to match input vectors in a training set.

SOMLearner

SOMLearner class constructs an instance of SOMClassifier or if given a classless domain an instance of SOMMap. SOMClassifier is actualy just a SOMMap with a defined call function that returns a majority class at the winning node.

Attributes

xDim
X dimension of the map (default 10)
yDim
Y dimension of the map (default 10)
topology
Topology of the map. Can be a SOMLearner.RetangularTopology for rectangular or SOMLearner.HexagonalTopology (default) for hexagonal topology
neighborhood
Neighborhood function type. Can be SOMLearner.BubbleNeighborhood (default) or SOMLearner.GaussianNeighborhood
steps
Number of steps (default 2)
alphaType
A alpha function type. Can be a SOMLearner.LinearFunction (default) or SOMLearner.InverseFunction
alpha
A list of alpha values (learning rate) to be used at the beginning of each step (default [0.05,0.03]
iterations
A list of iterations at each step (default [1000, 10000])
radius
A list of radius values for neighborhood function at each step (default [10,5])
domainContinuizer
Domain continuizer used to transform the domain
transformedDomain
Transformed domain
randomSeed
Random seed used to initialize the codebook vectors. Use -1 to use current time as a seed (default 0).

SOMMap

SOMMap holds the resulting 2 dimensional map of SOMNodes

Attributes

xDim
X dimension of the map
yDim
Y dimension of the map
topology
Topology of the map. Can be a SOMLearner.RetangularTopology for rectangular or SOMLearner.HexagonalTopology (default) for hexagonal topology
neighborhood
Neighborhood function type. Can be SOMLearner.BubbleNeighborhood (default) or SOMLearner.GaussianNeighborhood
nodes
A list of SOMNodes
transformedDomain
Transformed domain
error
Quantiztion error of the map

Methods

getWinner(example) ((example)->SOMNode)
Returns the node closest to the example

SOMNode

SOMNode holds the codebook vector

Attributes

vector
Holds the codebook vector
examples
Holds the examples for whitch this is the winning node

Methods

getDistance(example) ((example)->float)
Computes the distance to the node

Examples

>>>data=orange.ExampleTable("iris") >>>map=orange.SOMLearner(data) >>>print map.nodes[0].examples ... ... >>>print map.nodes[0].vector ... >>>map.getDistance(data[0]) 1.56