O
- Vector typeD
- Distance typepublic class RangeQueryBenchmarkAlgorithm<O extends NumberVector<?>,D extends NumberDistance<D,?>> extends AbstractDistanceBasedAlgorithm<O,D,Result>
x y z label 1 2 3 Example1 4 5 6 Example2 7 8 9 Example3and a query file:
x y z radius 1 2 3 1.2 4 5 6 3.3 7 8 9 4.1where the additional column is the radius. Alternatively, if you work with a single file, you need to use the filter command -dbc.filter SplitNumberVectorFilter -split.dims 1,2,3 to split the relation into a 3-dimensional data vector, and 1 dimensional radius vector. TODO: alternatively, allow using a fixed radius?
Modifier and Type | Class and Description |
---|---|
static class |
RangeQueryBenchmarkAlgorithm.Parameterizer<O extends NumberVector<?>,D extends NumberDistance<D,?>>
Parameterization class
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
The logger for this class.
|
protected DatabaseConnection |
queries
The alternate query point source.
|
protected RandomFactory |
random
Random generator factory
|
protected double |
sampling
Sampling size.
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
RangeQueryBenchmarkAlgorithm(DistanceFunction<? super O,D> distanceFunction,
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, with a separate query set.
|
Result |
run(Database database,
Relation<O> relation,
Relation<NumberVector<?>> radrel)
Run the algorithm, with separate radius relation
|
getDistanceFunction
makeParameterDistanceFunction, run
private static final Logging LOG
protected DatabaseConnection queries
protected double sampling
protected RandomFactory random
public RangeQueryBenchmarkAlgorithm(DistanceFunction<? super O,D> distanceFunction, DatabaseConnection queries, double sampling, RandomFactory random)
distanceFunction
- Distance function to usequeries
- Query data set (may be null!)sampling
- Sampling raterandom
- Random factorypublic Result run(Database database, Relation<O> relation, Relation<NumberVector<?>> radrel)
database
- Databaserelation
- Relationradrel
- Radius relationpublic Result run(Database database, Relation<O> relation)
database
- Databaserelation
- Relationpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Result>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Result>