Package elki.application.benchmark
Class PrioritySearchBenchmark<O>
- java.lang.Object
-
- elki.application.AbstractApplication
-
- elki.application.AbstractDistanceBasedApplication<O>
-
- elki.application.benchmark.PrioritySearchBenchmark<O>
-
- Type Parameters:
O
- Object type
public class PrioritySearchBenchmark<O> extends AbstractDistanceBasedApplication<O>
Benchmarking experiment that computes the k nearest neighbors for each query point. The query points can either come from a separate data source, or from the original database.- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected int
k
Number of neighbors to retrieve.private static Logging
LOG
The logger for this class.protected DatabaseConnection
queries
The alternate query point source.protected RandomFactory
random
Random generator factoryprotected double
sampling
Sampling size.-
Fields inherited from class elki.application.AbstractDistanceBasedApplication
distance, inputstep
-
Fields inherited from class elki.application.AbstractApplication
REFERENCE, VERSION
-
-
Constructor Summary
Constructors Constructor Description PrioritySearchBenchmark(InputStep inputstep, Distance<? super O> distance, int k, DatabaseConnection queries, double sampling, RandomFactory random)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
logIndexStatistics(Database database)
Log index statistics before and after querying.static void
main(java.lang.String[] args)
Runs the benchmarkvoid
run()
Runs the application.private int
run(PrioritySearcher<DBIDRef> priQuery, Relation<O> relation, Duration dur, MeanVariance mv, MeanVariance mvdist)
Run with the database as query sourceprivate int
run(PrioritySearcher<O> priQuery, Duration dur, MeanVariance mv, MeanVariance mvdist)
Run using a second database as query source-
Methods inherited from class elki.application.AbstractApplication
printErrorMessage, runCLIApplication, usage
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The logger for this class.
-
k
protected int k
Number of neighbors to retrieve.
-
queries
protected DatabaseConnection queries
The alternate query point source. Optional.
-
sampling
protected double sampling
Sampling size.
-
random
protected RandomFactory random
Random generator factory
-
-
Constructor Detail
-
PrioritySearchBenchmark
public PrioritySearchBenchmark(InputStep inputstep, Distance<? super O> distance, int k, DatabaseConnection queries, double sampling, RandomFactory random)
Constructor.- Parameters:
inputstep
- Input stepdistance
- Distance function to usek
- K parameterqueries
- Query data set (may be null!)sampling
- Sampling raterandom
- Random factory
-
-
Method Detail
-
run
public void run()
Description copied from class:AbstractApplication
Runs the application.- Specified by:
run
in classAbstractApplication
-
logIndexStatistics
private void logIndexStatistics(Database database)
Log index statistics before and after querying.- Parameters:
database
- Database
-
run
private int run(PrioritySearcher<DBIDRef> priQuery, Relation<O> relation, Duration dur, MeanVariance mv, MeanVariance mvdist)
Run with the database as query source- Parameters:
priQuery
- Query objectrelation
- Input datadur
- Durationmv
- statistics collectormvdist
- statistics collector- Returns:
- hash code of the results
-
run
private int run(PrioritySearcher<O> priQuery, Duration dur, MeanVariance mv, MeanVariance mvdist)
Run using a second database as query source- Parameters:
priQuery
- Query objectdur
- Durationmv
- statistics collectormvdist
- statistics collector- Returns:
- hash code of the results
-
main
public static void main(java.lang.String[] args)
Runs the benchmark- Parameters:
args
- parameter list according to description
-
-