L
- Label type.public class KDTreeSpatialIndex<L> extends Object implements SpatialIndex<L>
SpatialIndex
. Asymptotic runtime complexity of finding k
closest
elements is O(log(n)*k)
, but it degrades on high dimensional data.Constructor and Description |
---|
KDTreeSpatialIndex(List<LabeledVector<L>> data,
DistanceMeasure distanceMeasure)
Constructs a new instance of KD tree spatial index.
|
Modifier and Type | Method and Description |
---|---|
List<LabeledVector<L>> |
findKClosest(int k,
Vector pnt)
Finds
k closest elements to the specified point. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public KDTreeSpatialIndex(List<LabeledVector<L>> data, DistanceMeasure distanceMeasure)
data
- Data points.distanceMeasure
- Distance measure.public List<LabeledVector<L>> findKClosest(int k, Vector pnt)
k
closest elements to the specified point.findKClosest
in interface SpatialIndex<L>
k
- Number of elements to be returned.pnt
- Point to be used to calculate distance to other points.k
closest elements to the specified point.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024