Class HitHistogram
- java.lang.Object
-
- org.apache.commons.math3.ml.neuralnet.twod.util.HitHistogram
-
- All Implemented Interfaces:
MapDataVisualization
public class HitHistogram extends java.lang.Object implements MapDataVisualization
Computes the hit histogram. Each bin will contain the number of data for which the corresponding neuron is the best matching unit.- Since:
- 3.6
-
-
Field Summary
Fields Modifier and Type Field Description private DistanceMeasure
distance
Distance.private boolean
normalizeCount
Whether to compute relative bin counts.
-
Constructor Summary
Constructors Constructor Description HitHistogram(boolean normalizeCount, DistanceMeasure distance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[][]
computeImage(NeuronSquareMesh2D map, java.lang.Iterable<double[]> data)
Creates an image of thedata
metrics when represented by themap
.
-
-
-
Field Detail
-
distance
private final DistanceMeasure distance
Distance.
-
normalizeCount
private final boolean normalizeCount
Whether to compute relative bin counts.
-
-
Constructor Detail
-
HitHistogram
public HitHistogram(boolean normalizeCount, DistanceMeasure distance)
- Parameters:
normalizeCount
- Whether to compute relative bin counts. Iftrue
, the data count in each bin will be divided by the total number of samples.distance
- Distance.
-
-
Method Detail
-
computeImage
public double[][] computeImage(NeuronSquareMesh2D map, java.lang.Iterable<double[]> data)
Creates an image of thedata
metrics when represented by themap
.- Specified by:
computeImage
in interfaceMapDataVisualization
- Parameters:
map
- Map.data
- Data.- Returns:
- a 2D-array (in row major order) representing the metrics.
-
-