|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<R>
de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm<V,D,DataStore<KNNList<D>>>
de.lmu.ifi.dbs.elki.algorithm.KNNJoin<V,D,N,E>
V - the type of FeatureVector handled by this AlgorithmD - the type of Distance used by this AlgorithmN - the type of node used in the spatial index structureE - the type of entry used in the spatial node@Title(value="K-Nearest Neighbor Join") @Description(value="Algorithm to find the k-nearest neighbors of each object in a spatial database") public class KNNJoin<V extends NumberVector<V,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>

Joins in a given spatial database to each object its k-nearest neighbors. This algorithm only supports spatial databases based on a spatial index structure.
| Nested Class Summary | |
|---|---|
static class |
KNNJoin.Parameterizer<V extends NumberVector<V,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>
Parameterization class. |
| Field Summary | |
|---|---|
(package private) int |
k
The k parameter |
static OptionID |
K_ID
Parameter that specifies the k-nearest neighbors to be assigned, must be an integer greater than 0. |
private static Logging |
logger
The logger for this class. |
| Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm |
|---|
DISTANCE_FUNCTION_ID |
| Constructor Summary | |
|---|---|
KNNJoin(DistanceFunction<? super V,D> distanceFunction,
int k)
Constructor. |
|
| Method Summary | |
|---|---|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query. |
protected Logging |
getLogger()
Get the (STATIC) logger for this class. |
private D |
processDataPages(DistanceQuery<V,D> distQ,
N pr,
N ps,
WritableDataStore<KNNHeap<D>> knnLists,
D pr_knn_distance)
Processes the two data pages pr and ps and determines the k-nearest neighbors of pr in ps. |
DataStore<KNNList<D>> |
run(Database database,
Relation<V> relation)
Joins in the given spatial database to each object its k-nearest neighbors. |
| Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm |
|---|
getDistanceFunction |
| Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm |
|---|
makeParameterDistanceFunction, run |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logging logger
public static final OptionID K_ID
int k
| Constructor Detail |
|---|
public KNNJoin(DistanceFunction<? super V,D> distanceFunction,
int k)
distanceFunction - Distance functionk - k parameter| Method Detail |
|---|
public DataStore<KNNList<D>> run(Database database,
Relation<V> relation)
throws IllegalStateException
IllegalStateException - if not suitable SpatialIndexTree was
found or the specified distance function is not an instance of
SpatialPrimitiveDistanceFunction.
private D processDataPages(DistanceQuery<V,D> distQ,
N pr,
N ps,
WritableDataStore<KNNHeap<D>> knnLists,
D pr_knn_distance)
distQ - the distance to usepr - the first data pageps - the second data pageknnLists - the knn lists for each data objectpr_knn_distance - the current knn distance of data page pr
public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction in interface AlgorithmgetInputTypeRestriction in class AbstractAlgorithm<DataStore<KNNList<D extends Distance<D>>>>protected Logging getLogger()
AbstractAlgorithm
getLogger in class AbstractAlgorithm<DataStore<KNNList<D extends Distance<D>>>>
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||