Package elki.index.preprocessed.knn
Class AbstractMaterializeKNNPreprocessor<O>
- java.lang.Object
-
- elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor<O>
-
- Type Parameters:
O- Object type
- All Implemented Interfaces:
elki.index.Index,elki.index.KNNIndex<O>
- Direct Known Subclasses:
MaterializeKNNPreprocessor,NNDescent,PartitionApproximationMaterializeKNNPreprocessor,RandomSampleKNNPreprocessor,SpacefillingMaterializeKNNPreprocessor
public abstract class AbstractMaterializeKNNPreprocessor<O> extends java.lang.Object implements elki.index.KNNIndex<O>Abstract base class for KNN Preprocessors.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractMaterializeKNNPreprocessor.Factory<O>The parameterizable factory.
-
Field Summary
Fields Modifier and Type Field Description protected elki.distance.Distance<? super O>distanceThe distance function to be used.protected elki.database.query.distance.DistanceQuery<O>distanceQueryThe distance query we used.protected intkThe query k value.protected elki.database.relation.Relation<O>relationThe relation we are bound to.protected elki.database.datastore.WritableDataStore<elki.database.ids.KNNList>storageThe data store.
-
Constructor Summary
Constructors Constructor Description AbstractMaterializeKNNPreprocessor(elki.database.relation.Relation<O> relation, elki.database.query.distance.DistanceQuery<O> distanceQuery, int k)Constructor.AbstractMaterializeKNNPreprocessor(elki.database.relation.Relation<O> relation, elki.distance.Distance<? super O> distance, int k)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) voidcreateStorage()Create the default storage.elki.database.ids.KNNListget(elki.database.ids.DBIDRef id)Get the k nearest neighbors.elki.database.query.distance.DistanceQuery<O>getDistanceQuery()The distance query we used.intgetK()Get the value of 'k' supported by this preprocessor.protected abstract elki.logging.LogginggetLogger()Get the classes static logger.voidinitialize()PreprocessorKNNQuerykNNByDBID(elki.database.query.distance.DistanceQuery<O> distQ, int maxk, int flags)elki.database.query.knn.KNNSearcher<O>kNNByObject(elki.database.query.distance.DistanceQuery<O> distanceQuery, int maxk, int flags)Deprecated.not possibleprotected abstract voidpreprocess()Perform the preprocessing step.
-
-
-
Field Detail
-
relation
protected final elki.database.relation.Relation<O> relation
The relation we are bound to.
-
k
protected final int k
The query k value.
-
distance
protected final elki.distance.Distance<? super O> distance
The distance function to be used.
-
distanceQuery
protected final elki.database.query.distance.DistanceQuery<O> distanceQuery
The distance query we used.
-
storage
protected elki.database.datastore.WritableDataStore<elki.database.ids.KNNList> storage
The data store.
-
-
Method Detail
-
getDistanceQuery
public elki.database.query.distance.DistanceQuery<O> getDistanceQuery()
The distance query we used.- Returns:
- Distance query
-
getK
public int getK()
Get the value of 'k' supported by this preprocessor.- Returns:
- k
-
preprocess
protected abstract void preprocess()
Perform the preprocessing step.
-
get
public elki.database.ids.KNNList get(elki.database.ids.DBIDRef id)
Get the k nearest neighbors.- Parameters:
id- Object ID- Returns:
- Neighbors
-
createStorage
void createStorage()
Create the default storage.
-
initialize
public void initialize()
- Specified by:
initializein interfaceelki.index.Index
-
kNNByObject
@Deprecated public elki.database.query.knn.KNNSearcher<O> kNNByObject(elki.database.query.distance.DistanceQuery<O> distanceQuery, int maxk, int flags)
Deprecated.not possible- Specified by:
kNNByObjectin interfaceelki.index.KNNIndex<O>
-
kNNByDBID
public PreprocessorKNNQuery kNNByDBID(elki.database.query.distance.DistanceQuery<O> distQ, int maxk, int flags)
- Specified by:
kNNByDBIDin interfaceelki.index.KNNIndex<O>
-
getLogger
protected abstract elki.logging.Logging getLogger()
Get the classes static logger.- Returns:
- Logger
-
-