public class VPTree
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
VPTree.Node |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EUCLIDEAN |
Constructor and Description |
---|
VPTree(org.nd4j.linalg.api.ndarray.INDArray items) |
VPTree(org.nd4j.linalg.api.ndarray.INDArray items,
java.lang.String similarityFunction) |
VPTree(org.nd4j.linalg.api.ndarray.INDArray items,
java.lang.String similarityFunction,
boolean invert) |
VPTree(java.util.List<DataPoint> items) |
VPTree(java.util.List<DataPoint> items,
CounterMap<DataPoint,DataPoint> distances) |
VPTree(java.util.List<DataPoint> items,
CounterMap<DataPoint,DataPoint> distances,
java.lang.String similarityFunction) |
VPTree(java.util.List<DataPoint> items,
CounterMap<DataPoint,DataPoint> distances,
java.lang.String similarityFunction,
boolean invert) |
VPTree(java.util.List<DataPoint> items,
java.lang.String similarityFunction) |
VPTree(java.util.List<DataPoint> items,
java.lang.String similarityFunction,
boolean invert) |
Modifier and Type | Method and Description |
---|---|
static org.nd4j.linalg.api.ndarray.INDArray |
buildFromData(java.util.List<DataPoint> data) |
CounterMap<DataPoint,DataPoint> |
getDistances() |
java.util.List<DataPoint> |
getItems() |
void |
search(DataPoint target,
int k,
java.util.List<DataPoint> results,
java.util.List<java.lang.Double> distances) |
void |
search(VPTree.Node node,
DataPoint target,
int k,
PriorityQueue<HeapItem> pq) |
void |
setDistances(CounterMap<DataPoint,DataPoint> distances) |
void |
setItems(java.util.List<DataPoint> items) |
public static final java.lang.String EUCLIDEAN
public VPTree(org.nd4j.linalg.api.ndarray.INDArray items, java.lang.String similarityFunction, boolean invert)
items
- the items to usesimilarityFunction
- the similiarity function to useinvert
- whether to invert the distance (similarity functions have different min/max objectives)public VPTree(java.util.List<DataPoint> items, CounterMap<DataPoint,DataPoint> distances, java.lang.String similarityFunction, boolean invert)
items
- the items to usedistances
- the distancessimilarityFunction
- the similarity function to useinvert
- whether to invert the metric (different optimization objective)public VPTree(java.util.List<DataPoint> items, java.lang.String similarityFunction, boolean invert)
public VPTree(org.nd4j.linalg.api.ndarray.INDArray items, java.lang.String similarityFunction)
public VPTree(java.util.List<DataPoint> items, CounterMap<DataPoint,DataPoint> distances, java.lang.String similarityFunction)
public VPTree(java.util.List<DataPoint> items, java.lang.String similarityFunction)
public VPTree(org.nd4j.linalg.api.ndarray.INDArray items)
public VPTree(java.util.List<DataPoint> items, CounterMap<DataPoint,DataPoint> distances)
public VPTree(java.util.List<DataPoint> items)
public static org.nd4j.linalg.api.ndarray.INDArray buildFromData(java.util.List<DataPoint> data)
public java.util.List<DataPoint> getItems()
public void setItems(java.util.List<DataPoint> items)
public void search(DataPoint target, int k, java.util.List<DataPoint> results, java.util.List<java.lang.Double> distances)
public void search(VPTree.Node node, DataPoint target, int k, PriorityQueue<HeapItem> pq)
public CounterMap<DataPoint,DataPoint> getDistances()
public void setDistances(CounterMap<DataPoint,DataPoint> distances)