Main Content


Self-organizing map


Self-organizing maps learn to cluster data based on similarity, topology, with a preference (but no guarantee) of assigning the same number of instances to each class.

You can use self-organizing maps to cluster data and to reduce the dimensionality of data. They are inspired by the sensory and motor mappings in the mammal brain, which also appear to automatically organizing information topologically.


selfOrgMap = selforgmap(dimensions) takes a row vector of dimension sizes and returns a self-organizing map.

selfOrgMap = selforgmap(dimensions,coverSteps,initNeighbor,topologyFcn,distanceFcn) takes a row vector of dimension sizes and also a number of training steps for initial covering, an initial neighborhood size, a layer topology function, and a neuron distance function, and returns a self-organizing map.


collapse all

This example shows how to use a self-organizing map to cluster a simple set of data.

x = simplecluster_dataset;
net = selforgmap([8 8]);
net = train(net,x);

Figure Neural Network Training (26-Feb-2022 11:16:03) contains an object of type uigridlayout.


y = net(x);
classes = vec2ind(y);

Input Arguments

collapse all

Dimension sizes, specified as a row vector.

Number of training steps for initial covering of the input space, specified as a scalar.

Initial neighborhood size, specified as a scalar.

Layer topology function, specified as a topology function.

Neuron distance function, specified as a distance function.

Output Arguments

collapse all

Self-organizing map, returned as a network object.

Version History

Introduced in R2010b