Package smile.neighbor
Class RandomProjectionTree
java.lang.Object
smile.neighbor.RandomProjectionTree
- All Implemented Interfaces:
KNNSearch<double[],
double[]>
Random projection trees. The Random Projection Tree structures are space
partitioning data structures that automatically adapt to various notions
of intrinsic dimensionality of data.
-
Method Summary
Modifier and TypeMethodDescriptionList
<int[]> Returns the list of samples in each leaf node.int
Returns the number of leaf nodes in the tree.int
numNodes()
Returns the number of nodes in the tree.static RandomProjectionTree
of
(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:KNNSearch
Retrieves 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.
-