|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.index.AbstractIndex<O> de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex<O,TreeSetDBIDs> de.lmu.ifi.dbs.elki.index.preprocessed.snn.SharedNearestNeighborPreprocessor<O,D>
O
- the type of database objects the preprocessor can be applied toD
- the type of distance the used distance function will return@Title(value="Shared nearest neighbor Preprocessor") @Description(value="Computes the k nearest neighbors of objects of a certain database.") public class SharedNearestNeighborPreprocessor<O,D extends Distance<D>>
A preprocessor for annotation of the ids of nearest neighbors to each database object.
The k nearest neighbors are assigned based on an arbitrary distance function. This functionality is similar but not identical toMaterializeKNNPreprocessor
: While it also computes the k nearest
neighbors, it does not keep the actual distances, but organizes the NN set in
a TreeSet for fast set operations.
Nested Class Summary | |
---|---|
static class |
SharedNearestNeighborPreprocessor.Factory<O,D extends Distance<D>>
Factory class |
Field Summary | |
---|---|
protected DistanceFunction<O,D> |
distanceFunction
Hold the distance function to be used. |
private static Logging |
logger
Get a logger for this class. |
protected int |
numberOfNeighbors
Holds the number of nearest neighbors to be used. |
Fields inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex |
---|
storage |
Fields inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex |
---|
relation |
Constructor Summary | |
---|---|
SharedNearestNeighborPreprocessor(Relation<O> relation,
int numberOfNeighbors,
DistanceFunction<O,D> distanceFunction)
Constructor. |
Method Summary | |
---|---|
protected Logging |
getLogger()
Get the classes static logger. |
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus. |
TreeSetDBIDs |
getNearestNeighborSet(DBID objid)
Get the precomputed nearest neighbors |
int |
getNumberOfNeighbors()
Get the number of neighbors |
String |
getShortName()
A short name for the result, useful for file names. |
protected void |
preprocess()
Preprocessing step. |
Methods inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex |
---|
delete, deleteAll, getPageFileStatistics, insert, insertAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.index.Index |
---|
delete, deleteAll, getPageFileStatistics, insert, insertAll |
Field Detail |
---|
private static final Logging logger
protected int numberOfNeighbors
protected DistanceFunction<O,D extends Distance<D>> distanceFunction
Constructor Detail |
---|
public SharedNearestNeighborPreprocessor(Relation<O> relation, int numberOfNeighbors, DistanceFunction<O,D> distanceFunction)
relation
- Database to usenumberOfNeighbors
- Number of neighborsdistanceFunction
- Distance functionMethod Detail |
---|
protected void preprocess()
public TreeSetDBIDs getNearestNeighborSet(DBID objid)
SharedNearestNeighborIndex
getNearestNeighborSet
in interface SharedNearestNeighborIndex<O>
objid
- Object ID
protected Logging getLogger()
AbstractPreprocessorIndex
getLogger
in class AbstractPreprocessorIndex<O,TreeSetDBIDs>
public String getLongName()
Result
getLongName
in interface Result
getLongName
in class AbstractIndex<O>
public String getShortName()
Result
getShortName
in interface Result
getShortName
in class AbstractIndex<O>
public int getNumberOfNeighbors()
getNumberOfNeighbors
in interface SharedNearestNeighborIndex<O>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |