public class MapUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int[][] |
computeHitHistogram(Iterable<double[]> data,
NeuronSquareMesh2D map,
DistanceMeasure distance)
Computes the "hit" histogram of a two-dimensional map.
|
static double |
computeQuantizationError(Iterable<double[]> data,
Iterable<Neuron> neurons,
DistanceMeasure distance)
Computes the quantization error.
|
static double |
computeTopographicError(Iterable<double[]> data,
Network net,
DistanceMeasure distance)
Computes the topographic error.
|
static double[][] |
computeU(NeuronSquareMesh2D map,
DistanceMeasure distance)
Computes the
U-matrix of a two-dimensional map.
|
static Neuron |
findBest(double[] features,
Iterable<Neuron> neurons,
DistanceMeasure distance)
Finds the neuron that best matches the given features.
|
static Pair<Neuron,Neuron> |
findBestAndSecondBest(double[] features,
Iterable<Neuron> neurons,
DistanceMeasure distance)
Finds the two neurons that best match the given features.
|
static Neuron[] |
sort(double[] features,
Iterable<Neuron> neurons,
DistanceMeasure distance)
Creates a list of neurons sorted in increased order of the distance
to the given
features . |
public static Neuron findBest(double[] features, Iterable<Neuron> neurons, DistanceMeasure distance)
features
- Data.neurons
- List of neurons to scan. If the list is empty
null
will be returned.distance
- Distance function. The neuron's features are
passed as the first argument to DistanceMeasure.compute(double[],double[])
.DimensionMismatchException
- if the size of the input is not compatible with the neurons features
size.public static Pair<Neuron,Neuron> findBestAndSecondBest(double[] features, Iterable<Neuron> neurons, DistanceMeasure distance)
features
- Data.neurons
- List of neurons to scan. If the list is empty
null
will be returned.distance
- Distance function. The neuron's features are
passed as the first argument to DistanceMeasure.compute(double[],double[])
.DimensionMismatchException
- if the size of the input is not compatible with the neurons features
size.public static Neuron[] sort(double[] features, Iterable<Neuron> neurons, DistanceMeasure distance)
features
.features
- Data.neurons
- List of neurons to scan. If it is empty, an empty array
will be returned.distance
- Distance function.DimensionMismatchException
- if the size of the input is not compatible with the neurons features
size.findBest(double[],Iterable,DistanceMeasure)
,
findBestAndSecondBest(double[],Iterable,DistanceMeasure)
public static double[][] computeU(NeuronSquareMesh2D map, DistanceMeasure distance)
map
- Network.distance
- Function to use for computing the average
distance from a neuron to its neighbours.public static int[][] computeHitHistogram(Iterable<double[]> data, NeuronSquareMesh2D map, DistanceMeasure distance)
data
- Feature vectors.map
- Network.distance
- Function to use for determining the best matching unit.public static double computeQuantizationError(Iterable<double[]> data, Iterable<Neuron> neurons, DistanceMeasure distance)
data
- Feature vectors.neurons
- List of neurons to scan.distance
- Distance function.NoDataException
- if data
is empty.public static double computeTopographicError(Iterable<double[]> data, Network net, DistanceMeasure distance)
data
- Feature vectors.net
- Network.distance
- Distance function.NoDataException
- if data
is empty.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.