Class RandomProjectionTree
java.lang.Object
smile.neighbor.RandomProjectionTree
- All Implemented Interfaces:
KNNSearch<double[],double[]>
-
Method Summary
Modifier and TypeMethodDescriptionList<int[]> Returns the list of samples in each leaf node.intReturns the number of leaf nodes in the tree.intnumNodes()Returns the number of nodes in the tree.static RandomProjectionTreeof(double[][] data, int leafSize, boolean angular) Builds a random projection tree.Neighbor<double[],double[]>[] search(double[] q, int k) Retrieves the k nearest neighbors to the query key.
-
Method Details
-
search
Description copied from interface:KNNSearchRetrieves the k nearest neighbors to the query key. -
numNodes
public int numNodes()Returns the number of nodes in the tree.- Returns:
- the number of nodes in the tree.
-
numLeaves
public int numLeaves()Returns the number of leaf nodes in the tree.- Returns:
- the number of leaf nodes in the tree.
-
leafSamples
Returns the list of samples in each leaf node.- Returns:
- the list of samples in each leaf node.
-
of
Builds a random projection tree.- Parameters:
data- the data set.leafSize- The maximum size of leaf node.angular- true for angular metric, otherwise Euclidean.- Returns:
- A random projection tree.
-