Package elki.index.preprocessed.knn
Class NaiveProjectedKNNPreprocessor<O extends elki.data.NumberVector>
- java.lang.Object
-
- elki.index.preprocessed.knn.NaiveProjectedKNNPreprocessor<O>
-
- All Implemented Interfaces:
elki.index.Index,elki.index.KNNIndex<O>
@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 NaiveProjectedKNNPreprocessor<O extends elki.data.NumberVector> extends java.lang.Object implements elki.index.KNNIndex<O>Compute the approximate k nearest neighbors using 1 dimensional projections.This serves as a comparison method in:
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 classNaiveProjectedKNNPreprocessor.Factory<V extends elki.data.NumberVector>Index factory classprotected classNaiveProjectedKNNPreprocessor.NaiveProjectedKNNQueryKNN Query processor for naive projections.
-
Field Summary
Fields Modifier and Type Field Description private static elki.logging.LoggingLOGClass logger.(package private) elki.math.MeanmeanMean number of distance computations.(package private) elki.database.datastore.WritableDataStore<int[]>positionsCurve position storage(package private) elki.data.projection.random.RandomProjectionFamilyprojRandom projection family to use.(package private) java.util.List<elki.database.ids.ModifiableDoubleDBIDList>projectedProjected data.(package private) intprojectionsNumber of projections to use.(package private) java.util.RandomrandomRandom number generator.protected elki.database.relation.Relation<O>relationThe representation we are bound to.(package private) doublewindowCurve window size.
-
Constructor Summary
Constructors Constructor Description NaiveProjectedKNNPreprocessor(elki.database.relation.Relation<O> relation, double window, int projections, elki.data.projection.random.RandomProjectionFamily proj, java.util.Random random)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize()elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef>kNNByDBID(elki.database.query.distance.DistanceQuery<O> distanceQuery, int maxk, int flags)elki.database.query.knn.KNNSearcher<O>kNNByObject(elki.database.query.distance.DistanceQuery<O> distanceQuery, int maxk, int flags)voidlogStatistics()protected voidpreprocess()static int[]randomPermutation(int[] out, java.util.Random random)Perform a random permutation of the array, in-place.static int[]range(int start, int end)Initialize an integer value range.
-
-
-
Field Detail
-
relation
protected final elki.database.relation.Relation<O extends elki.data.NumberVector> relation
The representation we are bound to.
-
LOG
private static final elki.logging.Logging LOG
Class logger.
-
window
final double window
Curve window size.
-
projections
final int projections
Number of projections to use.
-
positions
elki.database.datastore.WritableDataStore<int[]> positions
Curve position storage
-
mean
elki.math.Mean mean
Mean number of distance computations.
-
proj
elki.data.projection.random.RandomProjectionFamily proj
Random projection family to use.
-
random
java.util.Random random
Random number generator.
-
projected
java.util.List<elki.database.ids.ModifiableDoubleDBIDList> projected
Projected data.
-
-
Constructor Detail
-
NaiveProjectedKNNPreprocessor
public NaiveProjectedKNNPreprocessor(elki.database.relation.Relation<O> relation, double window, int projections, elki.data.projection.random.RandomProjectionFamily proj, java.util.Random random)
Constructor.- Parameters:
relation- Relation to index.window- Window multiplicator.projections- Number of projections to use.proj- Projection family to use.random- Random number generator.
-
-
Method Detail
-
initialize
public void initialize()
- Specified by:
initializein interfaceelki.index.Index
-
preprocess
protected void preprocess()
-
range
public static int[] range(int start, int end)Initialize an integer value range.- Parameters:
start- Starting valueend- End value (exclusive)- Returns:
- Array of integers start..end, excluding end.
-
randomPermutation
public static int[] randomPermutation(int[] out, java.util.Random random)Perform a random permutation of the array, in-place. Knuth / Fisher-Yates style shuffle- Parameters:
out- Prefilled array to be modified.random- Random generator.- Returns:
- Same array.
-
logStatistics
public void logStatistics()
- Specified by:
logStatisticsin interfaceelki.index.Index
-
kNNByObject
public elki.database.query.knn.KNNSearcher<O> kNNByObject(elki.database.query.distance.DistanceQuery<O> distanceQuery, int maxk, int flags)
- Specified by:
kNNByObjectin interfaceelki.index.KNNIndex<O extends elki.data.NumberVector>
-
-