
public static class SharedNearestNeighborPreprocessor.Factory<O,D extends Distance<D>> extends Object implements SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborPreprocessor<O,D>>, Parameterizable
| Modifier and Type | Class and Description |
|---|---|
static class |
SharedNearestNeighborPreprocessor.Factory.Parameterizer<O,D extends Distance<D>>
Parameterization class.
|
| Modifier and Type | Field and Description |
|---|---|
static OptionID |
DISTANCE_FUNCTION_ID
Parameter to indicate the distance function to be used to ascertain the
nearest neighbors.
|
protected DistanceFunction<O,D> |
distanceFunction
Hold the distance function to be used.
|
static OptionID |
NUMBER_OF_NEIGHBORS_ID
Parameter to indicate the number of neighbors to be taken into account
for the shared-nearest-neighbor similarity.
|
protected int |
numberOfNeighbors
Holds the number of nearest neighbors to be used.
|
| Constructor and Description |
|---|
SharedNearestNeighborPreprocessor.Factory(int numberOfNeighbors,
DistanceFunction<O,D> distanceFunction)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TypeInformation |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
int |
getNumberOfNeighbors()
Get the number of neighbors
|
SharedNearestNeighborPreprocessor<O,D> |
instantiate(Relation<O> relation)
Instantiate the index for a given database.
|
public static final OptionID NUMBER_OF_NEIGHBORS_ID
Default value: 1
Key: sharedNearestNeighbors
public static final OptionID DISTANCE_FUNCTION_ID
Default value: EuclideanDistanceFunction
Key: SNNDistanceFunction
protected int numberOfNeighbors
protected DistanceFunction<O,D extends Distance<D>> distanceFunction
public SharedNearestNeighborPreprocessor.Factory(int numberOfNeighbors,
DistanceFunction<O,D> distanceFunction)
numberOfNeighbors - Number of neighborsdistanceFunction - Distance functionpublic SharedNearestNeighborPreprocessor<O,D> instantiate(Relation<O> relation)
SharedNearestNeighborIndex.Factoryinstantiate in interface IndexFactory<O,SharedNearestNeighborPreprocessor<O,D extends Distance<D>>>instantiate in interface SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborPreprocessor<O,D extends Distance<D>>>relation - Database typepublic int getNumberOfNeighbors()
getNumberOfNeighbors in interface SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborPreprocessor<O,D extends Distance<D>>>public TypeInformation getInputTypeRestriction()
IndexFactorygetInputTypeRestriction in interface IndexFactory<O,SharedNearestNeighborPreprocessor<O,D extends Distance<D>>>