de.lmu.ifi.dbs.elki.preprocessing
Class SpatialApproximationMaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.preprocessing.MaterializeKNNPreprocessor<O,D>
de.lmu.ifi.dbs.elki.preprocessing.SpatialApproximationMaterializeKNNPreprocessor<O,D,N,E>
- Type Parameters:
O
- the type of database objects the preprocessor can be applied toD
- the type of distance the used distance function will returnN
- the type of spatial nodes in the spatial indexE
- the type of spatial entries in the spatial index
- All Implemented Interfaces:
- Preprocessor<O>, Parameterizable
public class SpatialApproximationMaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>
- extends MaterializeKNNPreprocessor<O,D>
A preprocessor for annotation of the k nearest neighbors (and their
distances) to each database object.
Used for example by LOF
.
- Author:
- Erich Schubert
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpatialApproximationMaterializeKNNPreprocessor
public SpatialApproximationMaterializeKNNPreprocessor()
- Provides a k nearest neighbors Preprocessor.
run
public void run(Database<O> database,
boolean verbose,
boolean time)
- Annotates the nearest neighbors based on the values of
MaterializeKNNPreprocessor.k
and MaterializeKNNPreprocessor.distanceFunction
to each database
object.
- Specified by:
run
in interface Preprocessor<O extends NumberVector<O,?>>
- Overrides:
run
in class MaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>>
- Parameters:
database
- the database for which the preprocessing is performedverbose
- flag to allow verbose messages while performing the algorithmtime
- flag to request output of performance time
getSpatialDatabase
private SpatialIndexDatabase<O,N,E> getSpatialDatabase(Database<O> database)
throws IllegalStateException
- Do some (limited) type checking, then cast the database into a spatial database.
- Parameters:
database
- Database
- Returns:
- Spatial database.
- Throws:
IllegalStateException
- when the cast fails.
shortDescription
public String shortDescription()
- Provides a short description of the purpose of this class.
- Specified by:
shortDescription
in interface Parameterizable
- Overrides:
shortDescription
in class MaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>>
- Returns:
- Description of the class