O
- The object typeD
- The distance typepublic static class RandomSampleKNNPreprocessor.Factory<O,D extends Distance<D>> extends AbstractMaterializeKNNPreprocessor.Factory<O,D,KNNResult<D>>
Modifier and Type | Class and Description |
---|---|
static class |
RandomSampleKNNPreprocessor.Factory.Parameterizer<O,D extends Distance<D>>
Parameterization class
|
Modifier and Type | Field and Description |
---|---|
private RandomFactory |
rnd
Random generator
|
private double |
share
Relative share of objects to get
|
DISTANCE_FUNCTION_ID, distanceFunction, k, K_ID
Constructor and Description |
---|
RandomSampleKNNPreprocessor.Factory(int k,
DistanceFunction<? super O,D> distanceFunction,
double share,
RandomFactory rnd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RandomSampleKNNPreprocessor<O,D> |
instantiate(Relation<O> relation)
Sets the database in the distance function of this index (if existing).
|
getDistanceFactory, getDistanceFunction, getInputTypeRestriction
private final double share
private final RandomFactory rnd
public RandomSampleKNNPreprocessor.Factory(int k, DistanceFunction<? super O,D> distanceFunction, double share, RandomFactory rnd)
k
- KdistanceFunction
- distance functionshare
- Sample size (relative)rnd
- Random generatorpublic RandomSampleKNNPreprocessor<O,D> instantiate(Relation<O> relation)
IndexFactory
instantiate
in interface IndexFactory<O,KNNIndex<O>>
instantiate
in class AbstractMaterializeKNNPreprocessor.Factory<O,D extends Distance<D>,KNNResult<D extends Distance<D>>>
relation
- the relation to index