O
- Data object typepublic class PreprocessorKNNQuery<O> extends java.lang.Object implements KNNQuery<O>
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
Class logger
|
private AbstractMaterializeKNNPreprocessor<O> |
preprocessor
The last preprocessor result
|
protected Relation<? extends O> |
relation
The data to use for this query
|
private boolean |
warned
Warn only once.
|
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
PreprocessorKNNQuery(Relation<? extends O> relation,
AbstractMaterializeKNNPreprocessor<O> preprocessor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<KNNList> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
KNNList |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
KNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
protected Logging |
getLogger()
Get the class logger.
|
AbstractMaterializeKNNPreprocessor<O> |
getPreprocessor()
Get the preprocessor instance.
|
private static final Logging LOG
private final AbstractMaterializeKNNPreprocessor<O> preprocessor
private boolean warned
public PreprocessorKNNQuery(Relation<? extends O> relation, AbstractMaterializeKNNPreprocessor<O> preprocessor)
relation
- Relation to querypreprocessor
- Preprocessor instance to usepublic KNNList getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O>
id
- query object IDk
- Number of neighbors requestedpublic java.util.List<KNNList> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O>
ids
- query object IDsk
- Number of neighbors requestedpublic KNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O>
obj
- Query objectk
- Number of neighbors requestedpublic AbstractMaterializeKNNPreprocessor<O> getPreprocessor()
protected Logging getLogger()
Copyright © 2019 ELKI Development Team. License information.