
O - Object typepublic class KNNBenchmarkAlgorithm<O,D extends Distance<D>> extends AbstractDistanceBasedAlgorithm<O,D,Result>
| Modifier and Type | Class and Description | 
|---|---|
| static class  | KNNBenchmarkAlgorithm.Parameterizer<O,D extends Distance<D>>Parameterization class | 
| Modifier and Type | Field and Description | 
|---|---|
| protected int | kNumber of neighbors to retrieve. | 
| private static Logging | LOGThe logger for this class. | 
| protected DatabaseConnection | queriesThe alternate query point source. | 
| protected RandomFactory | randomRandom generator factory | 
| protected double | samplingSampling size. | 
DISTANCE_FUNCTION_ID| Constructor and Description | 
|---|
| KNNBenchmarkAlgorithm(DistanceFunction<? super O,D> distanceFunction,
                     int k,
                     DatabaseConnection queries,
                     double sampling,
                     RandomFactory random)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| TypeInformation[] | getInputTypeRestriction()Get the input type restriction used for negotiating the data query. | 
| protected Logging | getLogger()Get the (STATIC) logger for this class. | 
| Result | run(Database database,
   Relation<O> relation)Run the algorithm. | 
getDistanceFunctionmakeParameterDistanceFunction, runprivate static final Logging LOG
protected int k
protected DatabaseConnection queries
protected double sampling
protected RandomFactory random
public KNNBenchmarkAlgorithm(DistanceFunction<? super O,D> distanceFunction, int k, DatabaseConnection queries, double sampling, RandomFactory random)
distanceFunction - Distance function to usek - K parameterqueries - Query data set (may be null!)sampling - Sampling raterandom - Random factorypublic Result run(Database database, Relation<O> relation)
database - Databaserelation - Relationpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithmgetInputTypeRestriction in interface AlgorithmgetInputTypeRestriction in class AbstractAlgorithm<Result>protected Logging getLogger()
AbstractAlgorithmgetLogger in class AbstractAlgorithm<Result>