|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.tools.math.container.KDTree<T>
T - This is the type of value with is stored with the points and retrieved on nearest
neighbour searchpublic class KDTree<T extends java.io.Serializable>
This class is an implementation of a KD-Tree for organizing multidimensional datapoints in a fashion supporting the search for nearest neighbours. This is only working well in low dimensions.
| Constructor Summary | |
|---|---|
KDTree(int numberOfDimensions,
DistanceMeasure distance)
|
|
| Method Summary | |
|---|---|
void |
add(double[] values,
T storeValue)
This method has to be called in order to insert new values into the data structure |
T |
get(int index)
This returns the index-th value added to this collection. |
java.util.Collection<Tupel<java.lang.Double,T>> |
getNearestValueDistances(double withinDistance,
double[] values)
This method returns a collection of data from all sample points inside the specified distance. |
java.util.Collection<Tupel<java.lang.Double,T>> |
getNearestValueDistances(double withinDistance,
int butAtLeastK,
double[] values)
This method returns a collection of data from all sample points inside the specified distance but at least k points. |
java.util.Collection<Tupel<java.lang.Double,T>> |
getNearestValueDistances(int k,
double[] values)
This method returns a collection of data from the k nearest sample points. |
java.util.Collection<T> |
getNearestValues(int k,
double[] values)
This method returns a collection of the stored data values from the k nearest sample points. |
java.util.Iterator<T> |
iterator()
|
int |
size()
This method has to return the number of stored data points. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KDTree(int numberOfDimensions,
DistanceMeasure distance)
| Method Detail |
|---|
public void add(double[] values,
T storeValue)
GeometricDataCollection
add in interface GeometricDataCollection<T extends java.io.Serializable>values - specifies the geometric coordinates in data spacestoreValue - specifies the value at the given point
public java.util.Collection<T> getNearestValues(int k,
double[] values)
GeometricDataCollection
getNearestValues in interface GeometricDataCollection<T extends java.io.Serializable>k - the number of neighboursvalues - the coordinate of the querry point in the sample dimension
public java.util.Collection<Tupel<java.lang.Double,T>> getNearestValueDistances(int k,
double[] values)
GeometricDataCollection
getNearestValueDistances in interface GeometricDataCollection<T extends java.io.Serializable>k - the number of neighboursvalues - the coordinate of the querry point in the sample dimension
public java.util.Collection<Tupel<java.lang.Double,T>> getNearestValueDistances(double withinDistance,
double[] values)
GeometricDataCollection
getNearestValueDistances in interface GeometricDataCollection<T extends java.io.Serializable>values - the coordinate of the querry point in the sample dimension
public java.util.Collection<Tupel<java.lang.Double,T>> getNearestValueDistances(double withinDistance,
int butAtLeastK,
double[] values)
GeometricDataCollection
getNearestValueDistances in interface GeometricDataCollection<T extends java.io.Serializable>values - the coordinate of the querry point in the sample dimensionpublic int size()
GeometricDataCollection
size in interface GeometricDataCollection<T extends java.io.Serializable>public T get(int index)
GeometricDataCollection
get in interface GeometricDataCollection<T extends java.io.Serializable>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends java.io.Serializable>
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||