Top Description Fields Constructors Methods
org.apache.commons.math3.ml.neuralnet.twod.util

public Class UnifiedDistanceMatrix

extends Object
implements MapVisualization
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.ml.neuralnet.twod.util.MapVisualization
Imports
java.util.Collection, org.apache.commons.math3.ml.neuralnet.Neuron, .Network, org.apache.commons.math3.ml.neuralnet.twod.NeuronSquareMesh2D, org.apache.commons.math3.ml.distance.DistanceMeasure

U-Matrix visualization of high-dimensional data projection.
Since
3.6

Field Summary

Modifier and TypeField and Description
private final DistanceMeasure
distance

Distance.

private final boolean
individualDistances

Whether to show distance between each pair of neighbouring units.

Constructor Summary

AccessConstructor and Description
public
UnifiedDistanceMatrix(boolean
If true, the 8 individual inter-units distances will be computed. They will be stored in additional pixels around each of the original units of the 2D-map. The additional pixels that lie along a "diagonal" are shared by two pairs of units: their value will be set to the average distance between the units belonging to each of the pairs. The value zero will be stored in the pixel corresponding to the location of a unit of the 2D-map.
If false, only the average distance between a unit and all its neighbours will be computed (and stored in the pixel corresponding to that unit of the 2D-map). In that case, the number of neighbours taken into account depends on the network's neighbourhood type.
individualDistances
,
DistanceMeasure
Distance.
distance
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
private double[][]

Returns:

an image representing the average distances.
averageDistances
(NeuronSquareMesh2D
Map.
map
)

Computes the distances between a unit of the map and its neighbours.

public double[][]
private double[][]

Returns:

an image representing the individual distances.
individualDistances
(NeuronSquareMesh2D
Map.
map
)

Computes the distances between a unit of the map and its neighbours.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

distanceback to summary
private final DistanceMeasure distance

Distance.

individualDistancesback to summary
private final boolean individualDistances

Whether to show distance between each pair of neighbouring units.

Constructor Detail

UnifiedDistanceMatrixback to summary
public UnifiedDistanceMatrix(boolean individualDistances, DistanceMeasure distance)

Simple constructor.

Parameters
individualDistances:boolean

If true, the 8 individual inter-units distances will be computed. They will be stored in additional pixels around each of the original units of the 2D-map. The additional pixels that lie along a "diagonal" are shared by two pairs of units: their value will be set to the average distance between the units belonging to each of the pairs. The value zero will be stored in the pixel corresponding to the location of a unit of the 2D-map.
If false, only the average distance between a unit and all its neighbours will be computed (and stored in the pixel corresponding to that unit of the 2D-map). In that case, the number of neighbours taken into account depends on the network's neighbourhood type.

distance:DistanceMeasure

Distance.

Method Detail

averageDistancesback to summary
private double[][] averageDistances(NeuronSquareMesh2D map)

Computes the distances between a unit of the map and its neighbours.

Parameters
map:NeuronSquareMesh2D

Map.

Returns:double[][]

an image representing the average distances.

computeImageback to summary
public double[][] computeImage(NeuronSquareMesh2D map)

Implements org.apache.commons.math3.ml.neuralnet.twod.util.MapVisualization.computeImage.

Doc from org.apache.commons.math3.ml.neuralnet.twod.util.MapVisualization.computeImage.

Creates an image of the map.

Parameters
map:NeuronSquareMesh2D

Map.

Returns:double[][]

a 2D-array (in row major order) representing the property.

individualDistancesback to summary
private double[][] individualDistances(NeuronSquareMesh2D map)

Computes the distances between a unit of the map and its neighbours. The image will contain more pixels than the number of neurons in the given map because each neuron has 8 neighbours. The value zero will be stored in the pixels corresponding to the location of a map unit.

Parameters
map:NeuronSquareMesh2D

Map.

Returns:double[][]

an image representing the individual distances.