E
- the type of data objects in the tree.public class CoverTree<E> extends Object implements NearestNeighborSearch<E,E>, KNNSearch<E,E>, RNNSearch<E,E>
Constructor and Description |
---|
CoverTree(E[] dataset,
Metric<E> distance)
Constructor.
|
CoverTree(E[] dataset,
Metric<E> distance,
double base)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isIdenticalExcluded()
Get whether if query object self be excluded from the neighborhood.
|
Neighbor<E,E>[] |
knn(E q,
int k)
Search the k nearest neighbors to the query.
|
Neighbor<E,E> |
nearest(E q)
Search the nearest neighbor to the given sample.
|
void |
range(E q,
double radius,
List<Neighbor<E,E>> neighbors)
Search the neighbors in the given radius of query object, i.e.
|
void |
setIdenticalExcluded(boolean excluded)
Set if exclude query object self from the neighborhood.
|
String |
toString() |
public CoverTree(E[] dataset, Metric<E> distance)
dataset
- the data set for nearest neighbor search.distance
- a metric distance measure for nearest neighbor search.public void setIdenticalExcluded(boolean excluded)
public boolean isIdenticalExcluded()
public Neighbor<E,E> nearest(E q)
NearestNeighborSearch
nearest
in interface NearestNeighborSearch<E,E>
q
- the query key.public Neighbor<E,E>[] knn(E q, int k)
KNNSearch
Copyright © 2015. All rights reserved.