public class RPForest extends Object
Constructor and Description |
---|
RPForest(int numTrees,
int maxSize,
String similarityFunction)
Create the rp forest with the specified number of trees
|
Modifier and Type | Method and Description |
---|---|
void |
fit(INDArray x)
Build the trees from the given dataset
|
INDArray |
getAllCandidates(INDArray input)
Get all candidates relative to a specific datapoint.
|
INDArray |
queryAll(INDArray toQuery,
int n)
Query results up to length n
nearest neighbors
|
List<Pair<Double,Integer>> |
queryWithDistances(INDArray query,
int numResults)
Query all with the distances
sorted by index
|
public RPForest(int numTrees, int maxSize, String similarityFunction)
numTrees
- the number of trees in the forestmaxSize
- the max size of each treesimilarityFunction
- the distance function to usepublic void fit(INDArray x)
x
- the input dataset (should be a 2d matrix)public INDArray getAllCandidates(INDArray input)
input
- public INDArray queryAll(INDArray toQuery, int n)
toQuery
- the query itemn
- the number of nearest neighbors for the given data pointCopyright © 2020. All rights reserved.