Class MapRanking
- java.lang.Object
-
- org.apache.commons.math4.neuralnet.MapRanking
-
public class MapRanking extends Object
Utility for ranking the units (neurons) of a network.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description MapRanking(Iterable<Neuron> neurons, DistanceMeasure distance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Neuron>rank(double[] features)Creates a list of the neurons whose features best correspond to the givenfeatures.List<Neuron>rank(double[] features, int max)Creates a list of the neurons whose features best correspond to the givenfeatures.
-
-
-
Constructor Detail
-
MapRanking
public MapRanking(Iterable<Neuron> neurons, DistanceMeasure distance)
- Parameters:
neurons- List to be ranked. No defensive copy is performed. Thecreated list of unitswill be sorted in increasing order of thedistance.distance- Distance function.
-
-
Method Detail
-
rank
public List<Neuron> rank(double[] features)
Creates a list of the neurons whose features best correspond to the givenfeatures.- Parameters:
features- Data.- Returns:
- the list of neurons sorted in decreasing order of distance to the given data.
- Throws:
IllegalArgumentException- if the size of the input is not compatible with the neurons features size.
-
rank
public List<Neuron> rank(double[] features, int max)
Creates a list of the neurons whose features best correspond to the givenfeatures.- Parameters:
features- Data.max- Maximum size of the returned list.- Returns:
- the list of neurons sorted in decreasing order of distance to the given data.
- Throws:
IllegalArgumentException- if the size of the input is not compatible with the neurons features size ormax <= 0.
-
-