Package elki.index.preprocessed.knn
Class MetricalIndexApproximationMaterializeKNNPreprocessor<O extends NumberVector,N extends Node<E>,E extends MTreeEntry>
- java.lang.Object
-
- elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor<O>
-
- elki.index.preprocessed.knn.MetricalIndexApproximationMaterializeKNNPreprocessor<O,N,E>
-
- Type Parameters:
O
- the type of database objects the preprocessor can be applied toN
- the type of spatial nodes in the spatial indexE
- the type of spatial entries in the spatial index
@Title("Spatial Approximation Materialize kNN Preprocessor") @Description("Caterializes the (approximate) k nearest neighbors of objects of a database using a spatial approximation.") public class MetricalIndexApproximationMaterializeKNNPreprocessor<O extends NumberVector,N extends Node<E>,E extends MTreeEntry> extends AbstractMaterializeKNNPreprocessor<O>
A preprocessor for annotation of the k nearest neighbors (and their distances) to each database object. Used for example byLOF
. TODO correct handling of datastore events- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetricalIndexApproximationMaterializeKNNPreprocessor.Factory<O extends NumberVector,N extends Node<E>,E extends MTreeEntry>
The parameterizable factory.
-
Field Summary
Fields Modifier and Type Field Description private static Logging
LOG
Logger to use-
Fields inherited from class elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor
distance, distanceQuery, k, relation, storage
-
-
Constructor Summary
Constructors Constructor Description MetricalIndexApproximationMaterializeKNNPreprocessor(Relation<O> relation, Distance<? super O> distance, int k)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logging
getLogger()
Get the classes static logger.private MetricalIndexTree<O,N,E>
getMetricalIndex(Relation<? extends O> relation)
Do some (limited) type checking, then cast the database into a spatial database.protected void
preprocess()
Perform the preprocessing step.-
Methods inherited from class elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor
createStorage, get, getDistanceQuery, getK, initialize, kNNByDBID, kNNByObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.index.Index
logStatistics
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Logger to use
-
-
Method Detail
-
preprocess
protected void preprocess()
Description copied from class:AbstractMaterializeKNNPreprocessor
Perform the preprocessing step.- Specified by:
preprocess
in classAbstractMaterializeKNNPreprocessor<O extends NumberVector>
-
getMetricalIndex
private MetricalIndexTree<O,N,E> getMetricalIndex(Relation<? extends O> relation) throws java.lang.IllegalStateException
Do some (limited) type checking, then cast the database into a spatial database.- Parameters:
relation
- Database- Returns:
- Metrical index
- Throws:
java.lang.IllegalStateException
- when the cast fails.
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractMaterializeKNNPreprocessor
Get the classes static logger.- Specified by:
getLogger
in classAbstractMaterializeKNNPreprocessor<O extends NumberVector>
- Returns:
- Logger
-
-