org.ddogleg.nn
Class FactoryNearestNeighbor
- java.lang.Object
-
- org.ddogleg.nn.FactoryNearestNeighbor
-
public class FactoryNearestNeighbor extends java.lang.ObjectFactory for creating implementations ofNearestNeighbor.
-
-
Constructor Summary
Constructors Constructor and Description FactoryNearestNeighbor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <D> NearestNeighbor<D>exhaustive()Performs an optimalNearestNeighborby exhaustively consider all possible solutions.static <D> NearestNeighbor<D>kdRandomForest(int maxNodesSearched, int numTrees, int numConsiderSplit, long randomSeed)ApproximateNearestNeighborsearch which uses a set of randomly generated K-D trees and a Best-Bin-First search.static <D> NearestNeighbor<D>kdtree()Performs an optimalNearestNeighborsearch using K-D tree.static <D> NearestNeighbor<D>kdtree(int maxNodesSearched)Performs an approximateNearestNeighborsearch using K-D tree.static <D> NearestNeighbor<D>vptree(long randSeed)Vantage pointtree implementation for nearest neighbor search.
-
-
-
Method Detail
-
kdtree
public static <D> NearestNeighbor<D> kdtree()
Performs an optimalNearestNeighborsearch using K-D tree. Distance measure is Euclidean squared.- Type Parameters:
D- Associated data type.- Returns:
NearestNeighborimplementation- See Also:
KdTreeNearestNeighbor,AxisSplitterMedian
-
kdtree
public static <D> NearestNeighbor<D> kdtree(int maxNodesSearched)
Performs an approximateNearestNeighborsearch using K-D tree. Node are searched in Best-Bin-First order. Distance measure is Euclidean squared.- Type Parameters:
D- Associated data type.- Parameters:
maxNodesSearched- Maximum number of nodes it will search. Controls speed and accuracy.- Returns:
NearestNeighborimplementation- See Also:
KdTreeNearestNeighbor,KdTreeSearch1Bbf,AxisSplitterMedian
-
kdRandomForest
public static <D> NearestNeighbor<D> kdRandomForest(int maxNodesSearched, int numTrees, int numConsiderSplit, long randomSeed)
ApproximateNearestNeighborsearch which uses a set of randomly generated K-D trees and a Best-Bin-First search. Designed to work in high dimensional space. Distance measure is Euclidean squared.- Type Parameters:
D- Associated data type.- Parameters:
maxNodesSearched- Maximum number of nodes it will search. Controls speed and accuracy.numTrees- Number of trees that are considered. Try 10 and tune.numConsiderSplit- Number of nodes that are considered when generating a tree. Must be less than the point's dimension. Try 5randomSeed- Seed used by random number generator- Returns:
NearestNeighborimplementation- See Also:
KdForestBbfSearch,AxisSplitterMedian
-
exhaustive
public static <D> NearestNeighbor<D> exhaustive()
Performs an optimalNearestNeighborby exhaustively consider all possible solutions. Distance measure is Euclidean squared.- Type Parameters:
D- Associated data type.- Returns:
NearestNeighborimplementation- See Also:
ExhaustiveNeighbor
-
vptree
public static <D> NearestNeighbor<D> vptree(long randSeed)
Vantage pointtree implementation for nearest neighbor search. Slower than KD-Tree on random data, but faster than it for some pathological cases.- Type Parameters:
D- Associated data type.- Parameters:
randSeed- Random seed- Returns:
NearestNeighborimplementation- See Also:
VpTree
-
-
DataMelt 3.0 © DataMelt by jWork.ORG