Package elki.index.preprocessed.knn
Class SpacefillingMaterializeKNNPreprocessor<O extends NumberVector>
- java.lang.Object
-
- elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor<O>
-
- elki.index.preprocessed.knn.SpacefillingMaterializeKNNPreprocessor<O>
-
- Type Parameters:
O- Vector type indexed
@Reference(authors="Erich Schubert, Arthur Zimek, Hans-Peter Kriegel", title="Fast and Scalable Outlier Detection with Approximate Nearest Neighbor Ensembles", booktitle="Proc. 20th Int. Conf. Database Systems for Advanced Applications (DASFAA 2015)", url="https://doi.org/10.1007/978-3-319-18123-3_2", bibkey="DBLP:conf/dasfaa/SchubertZK15") public class SpacefillingMaterializeKNNPreprocessor<O extends NumberVector> extends AbstractMaterializeKNNPreprocessor<O>
Compute the nearest neighbors approximatively using space filling curves.This version does the bulk kNN-join operation, i.e. precomputes the k nearest neighbors for every object, then discards the curves. This is usually more memory intensive but faster than
SpacefillingKNNPreprocessor.Reference:
Erich Schubert, Arthur Zimek, Hans-Peter Kriegel
Fast and Scalable Outlier Detection with Approximate Nearest Neighbor Ensembles
Proc. 20th Int. Conf. Database Systems for Advanced Applications (DASFAA 2015)- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpacefillingMaterializeKNNPreprocessor.Factory<V extends NumberVector>Index factory class
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<? extends SpatialSorter>curvegenSpatial curve generatorsprivate static LoggingLOGClass logger(package private) MeanmeanMean number of distance computations(package private) java.util.RandomrandomRandom number generator.(package private) intvariantsNumber of variants to generate for each curve(package private) doublewindowCurve window size-
Fields inherited from class elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor
distance, distanceQuery, k, relation, storage
-
-
Constructor Summary
Constructors Constructor Description SpacefillingMaterializeKNNPreprocessor(Relation<O> relation, Distance<? super O> distance, int k, java.util.List<? extends SpatialSorter> curvegen, double window, int variants, java.util.Random random)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LogginggetLogger()Get the classes static logger.KNNSearcher<O>kNNByObject(DistanceQuery<O> distQ, int maxk, int flags)Get a KNN query object for the given distance query and k.voidlogStatistics()Send statistics to the logger, if enabled.protected voidpreprocess()Perform the preprocessing step.-
Methods inherited from class elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor
createStorage, get, getDistanceQuery, getK, initialize, kNNByDBID
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger
-
curvegen
final java.util.List<? extends SpatialSorter> curvegen
Spatial curve generators
-
window
final double window
Curve window size
-
variants
final int variants
Number of variants to generate for each curve
-
mean
Mean mean
Mean number of distance computations
-
random
java.util.Random random
Random number generator.
-
-
Constructor Detail
-
SpacefillingMaterializeKNNPreprocessor
public SpacefillingMaterializeKNNPreprocessor(Relation<O> relation, Distance<? super O> distance, int k, java.util.List<? extends SpatialSorter> curvegen, double window, int variants, java.util.Random random)
Constructor.- Parameters:
relation- Relation to index.distance- Distance functionk- kcurvegen- Curve generatorswindow- Window multiplicatorvariants- Number of curve variants to generaterandom- Random number generator
-
-
Method Detail
-
preprocess
protected void preprocess()
Description copied from class:AbstractMaterializeKNNPreprocessorPerform the preprocessing step.- Specified by:
preprocessin classAbstractMaterializeKNNPreprocessor<O extends NumberVector>
-
logStatistics
public void logStatistics()
Description copied from interface:IndexSend statistics to the logger, if enabled.Note: you must have set the logging level appropriately before initializing the index! Otherwise, the index might not have collected the desired statistics.
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractMaterializeKNNPreprocessorGet the classes static logger.- Specified by:
getLoggerin classAbstractMaterializeKNNPreprocessor<O extends NumberVector>- Returns:
- Logger
-
kNNByObject
public KNNSearcher<O> kNNByObject(DistanceQuery<O> distQ, int maxk, int flags)
Description copied from interface:KNNIndexGet a KNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
kNNByObjectin interfaceKNNIndex<O extends NumberVector>- Overrides:
kNNByObjectin classAbstractMaterializeKNNPreprocessor<O extends NumberVector>- Parameters:
distQ- Distance querymaxk- Maximum value of kflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
-