public class VPTree<V extends Vec> extends Object implements IncrementalCollection<V>
search(jsat.linear.Vec, int)
Modifier and Type | Class and Description |
---|---|
static class |
VPTree.VPSelection |
static class |
VPTree.VPTreeFactory<V extends Vec> |
Modifier | Constructor and Description |
---|---|
protected |
VPTree()
no-arg constructor for serialization
|
|
VPTree(DistanceMetric dm) |
|
VPTree(List<V> list,
DistanceMetric dm) |
|
VPTree(List<V> list,
DistanceMetric dm,
ExecutorService threadpool) |
|
VPTree(List<V> list,
DistanceMetric dm,
VPTree.VPSelection vpSelection) |
|
VPTree(List<V> list,
DistanceMetric dm,
VPTree.VPSelection vpSelection,
Random rand,
int sampleSize,
int searchIterations) |
|
VPTree(List<V> list,
DistanceMetric dm,
VPTree.VPSelection vpSelection,
Random rand,
int sampleSize,
int searchIterations,
ExecutorService threadpool) |
protected |
VPTree(VPTree<V> toClone)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
VPTree<V> |
clone() |
int |
getMaxLeafSize()
Returns the maximum leaf node size.
|
void |
insert(V x)
Incrementally adds the given datapoint into the collection
|
List<? extends VecPaired<V,Double>> |
search(Vec query,
double range)
Searches the space for all vectors that are within a given range of the query vector.
|
List<? extends VecPaired<V,Double>> |
search(Vec query,
int neighbors)
Searches the space for the k neighbors that are closest to the given query vector
|
void |
setMaxLeafSize(int maxLeafSize)
Sets the maximum leaf node size.
|
int |
size()
Returns the number of vectors stored in the collection
|
protected int |
splitListIndex(List<Pair<Double,Integer>> S)
Determines which index to use as the splitting index for the VP radius
|
public VPTree(List<V> list, DistanceMetric dm, VPTree.VPSelection vpSelection, Random rand, int sampleSize, int searchIterations, ExecutorService threadpool)
public VPTree(List<V> list, DistanceMetric dm, VPTree.VPSelection vpSelection, Random rand, int sampleSize, int searchIterations)
public VPTree(List<V> list, DistanceMetric dm, VPTree.VPSelection vpSelection)
public VPTree(List<V> list, DistanceMetric dm, ExecutorService threadpool)
public VPTree(List<V> list, DistanceMetric dm)
public VPTree(DistanceMetric dm)
protected VPTree(VPTree<V> toClone)
toClone
- the object to copyprotected VPTree()
public int size()
VectorCollection
size
in interface VectorCollection<V extends Vec>
public void insert(V x)
IncrementalCollection
insert
in interface IncrementalCollection<V extends Vec>
x
- the vector to add to the collectionpublic List<? extends VecPaired<V,Double>> search(Vec query, double range)
VectorCollection
search
in interface VectorCollection<V extends Vec>
query
- the vector we want to find others nearrange
- the search range around our querypublic List<? extends VecPaired<V,Double>> search(Vec query, int neighbors)
VectorCollection
search
in interface VectorCollection<V extends Vec>
query
- the vector we want to find neighbors ofneighbors
- the maximum number of neighbors to returnprotected int splitListIndex(List<Pair<Double,Integer>> S)
S
- the non empty list of elementspublic int getMaxLeafSize()
public void setMaxLeafSize(int maxLeafSize)
maxLeafSize
- the new maximum leaf node size.Copyright © 2017. All rights reserved.