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 SpacefillingKNNPreprocessor<O extends NumberVector> extends java.lang.Object implements KNNIndex<O>
This version computes the data projections and stores, then queries this data
on-demand. This usually needs less memory (except for very small neighborhood
sizes k) than SpacefillingMaterializeKNNPreprocessor, but will also
be slower.
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)
| Modifier and Type | Class and Description |
|---|---|
static class |
SpacefillingKNNPreprocessor.Factory<V extends NumberVector>
Index factory class
|
protected class |
SpacefillingKNNPreprocessor.SpaceFillingKNNQuery
KNN Query processor for space filling curves
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.List<SpatialSorter> |
curvegen
Spatial curve generators
|
(package private) java.util.List<java.util.List<SpatialPair<DBID,NumberVector>>> |
curves
Curve storage
|
private static Logging |
LOG
Class logger
|
(package private) Mean |
mean
Mean number of distance computations
|
(package private) int |
odim
Number of dimensions to use.
|
(package private) WritableDataStore<int[]> |
positions
Curve position storage
|
(package private) RandomProjectionFamily |
proj
Random projection family to use.
|
(package private) java.util.Random |
random
Random number generator.
|
protected Relation<O> |
relation
The representation we are bound to.
|
(package private) int |
variants
Number of variants to generate for each curve
|
(package private) double |
window
Curve window size
|
| Constructor and Description |
|---|
SpacefillingKNNPreprocessor(Relation<O> relation,
java.util.List<SpatialSorter> curvegen,
double window,
int variants,
int odim,
RandomProjectionFamily proj,
java.util.Random random)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
KNNQuery<O> |
getKNNQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a KNN query object for the given distance query and k.
|
java.lang.String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
java.lang.String |
getShortName()
A short name for the result, useful for file names.
|
void |
initialize()
Initialize the index.
|
void |
logStatistics()
Send statistics to the logger, if enabled.
|
protected void |
preprocess() |
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.
|
private static final Logging LOG
protected final Relation<O extends NumberVector> relation
final java.util.List<SpatialSorter> curvegen
final double window
final int variants
java.util.List<java.util.List<SpatialPair<DBID,NumberVector>>> curves
WritableDataStore<int[]> positions
Mean mean
final int odim
RandomProjectionFamily proj
java.util.Random random
public SpacefillingKNNPreprocessor(Relation<O> relation, java.util.List<SpatialSorter> curvegen, double window, int variants, int odim, RandomProjectionFamily proj, java.util.Random random)
relation - Relation to index.curvegen - Curve generatorswindow - Window multiplicatorvariants - Number of curve variants to generateodim - Number of dimensions to use -1 == all.proj - Random projection to applyrandom - Random number generatorpublic void initialize()
Indexinitialize in interface Indexprotected void preprocess()
public static int[] range(int start,
int end)
start - Starting valueend - End value (exclusive)public static int[] randomPermutation(int[] out,
java.util.Random random)
out - Prefilled output array.random - Random generator.public java.lang.String getLongName()
ResultgetLongName in interface Resultpublic java.lang.String getShortName()
ResultgetShortName in interface Resultpublic void logStatistics()
IndexlogStatistics in interface Indexpublic KNNQuery<O> getKNNQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
KNNIndexgetKNNQuery in interface KNNIndex<O extends NumberVector>distanceQuery - Distance queryhints - Hints for the optimizernullCopyright © 2019 ELKI Development Team. License information.