lshkit::Benchmark< KEY > Class Template Reference

Access a benchmark file. More...

#include <eval.h>

List of all members.

Public Member Functions

void resize (unsigned Q, unsigned K=0)
void init (unsigned Q, unsigned maxID)
void load (std::istream &is)
void save (std::ostream &os) const
void load (const std::string &path)
void save (const std::string &path) const
unsigned getQ () const
unsigned getQuery (unsigned n) const
 Get the ID of the nth query.
const Topk< KEY > & getAnswer (unsigned n) const
 Get the nearest neighbors of the nth query.
Topk< KEY > & getAnswer (unsigned n)
 Get the KNNs for modification.


Detailed Description

template<typename KEY = unsigned>
class lshkit::Benchmark< KEY >

Access a benchmark file.

We assume the feature vectors in the benchmark database are numbered from 0 to N. We sample Q queries as test examples and run K-NN search against the database with linear scan. The results are saved in a benchmark file for evaluation purpose. A benchmark file is made up of Q lines, each line represents a test query and is of the following format:

<query id>=""> <K> <1st NN's ID> <distance> <2nd NN's ID> <distance> ... <Kth NN's ID> <distance>

For all queries in the benchmark file, the K value should be the same.

Because the query points are also sampled from the database, they should be excluded from scanning when running this particular query.


The documentation for this class was generated from the following file:
Get LSHKIT at SourceForge.net. Fast, secure and Free Open Source software downloads doxygen