Table Of Contents

Previous topic

mappers.samplegroup

Next topic

mappers.svd

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

mappers.som

Module: mappers.som

Inheritance diagram for mvpa.mappers.som:

Self-organizing map (SOM) mapper.

SimpleSOMMapper

class mvpa.mappers.som.SimpleSOMMapper(kshape, niter, learning_rate=0.005, iradius=None)

Bases: mvpa.mappers.base.Mapper

Mapper using a self-organizing map (SOM) for dimensionality reduction.

This mapper provides a simple, but pretty fast implementation of a self-organizing map using an unsupervised training algorithm. It performs a ND -> 2D mapping, which can for, example, be used for visualization of high-dimensional data.

This SOM implementation uses squared Euclidean distance to determine the best matching Kohonen unit and a Gaussian neighborhood influence kernel.

Parameters:
  • kshape ((int, int)) – Shape of the internal Kohonen layer. Currently, only 2D Kohonen layers are supported, although the length of an axis might be set to 1.
  • niter (int) – Number of iteration during network training.
  • learning_rate (float) – Initial learning rate, which will continuously decreased during network training.
  • iradius (float | None) – Initial radius of the Gaussian neighborhood kernel radius, which will continuously decreased during network training. If None (default) the radius is set equal to the longest edge of the Kohonen layer.
K

Provide access to the Kohonen layer.

With some care.

forward(data)

Map data from the IN dataspace into OUT space.

Mapping is performs by simple determining the best matching Kohonen unit for each data sample.

getInId(outId)

Translate a feature id into a coordinate/index in input space.

This is not meaningful in the context of SOMs.

getInSize()

Returns the size of the entity in input space

getOutSize()

Returns the size of the entity in output space

isValidOutId(outId)

Validate feature id in OUT space.

reverse(data)

Reverse map data from OUT space into the IN space.

selectOut(outIds)

Limit the OUT space to a certain set of features.

This is currently not implemented. Moreover, although it is technically possible to implement this functionality, it is unsure whether it is meaningful in the context of SOMs.

train(ds)

Perform network training.

Parameters:ds (Dataset) – All samples in the dataset will be used for unsupervised training of the SOM.