QuickRank
v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
|
This class implements the basic functionalities of an IR evaluation metric. More...
#include <metric.h>
Public Member Functions | |
Metric (size_t k=NO_CUTOFF) | |
Creates a new metric with the specified cut-off threshold. More... | |
virtual | ~Metric () |
virtual std::string | name () const =0 |
Returns the name of the metric. More... | |
size_t | cutoff () const |
Returns the current cut-off of the Metric. More... | |
void | set_cutoff (size_t k) |
Updates the cut-off of the Metric. More... | |
virtual MetricScore | evaluate_result_list (const quickrank::data::QueryResults *rl, const Score *scores) const =0 |
Measures the quality of the given results list according to the Metric. More... | |
virtual MetricScore | evaluate_dataset (const std::shared_ptr< data::Dataset > dataset, const Score *scores) const |
virtual MetricScore | evaluate_dataset (const std::shared_ptr< data::VerticalDataset > dataset, const Score *scores) const |
virtual std::unique_ptr< Jacobian > | jacobian (std::shared_ptr< data::RankedResults > ranked) const |
Computes the Jacobian matrix. More... | |
Static Public Attributes | |
static const size_t | NO_CUTOFF = SIZE_MAX |
This should be used when no cut-off on the results list is required. More... | |
Private Member Functions | |
virtual std::ostream & | put (std::ostream &os) const =0 |
Prints the short name of the Metric, e.g., "NDCG@K". More... | |
Private Attributes | |
size_t | cutoff_ |
The metric cutoff. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Metric &m) |
The output stream operator. More... | |
This class implements the basic functionalities of an IR evaluation metric.
|
inlineexplicit |
Creates a new metric with the specified cut-off threshold.
k | The cut-off threshold. |
|
inlinevirtual |
|
inline |
Returns the current cut-off of the Metric.
|
inlinevirtual |
|
inlinevirtual |
|
pure virtual |
Measures the quality of the given results list according to the Metric.
rl | A results list. |
scores | a list of scores |
Implemented in quickrank::metric::ir::Ndcg, quickrank::metric::ir::Tndcg, quickrank::metric::ir::Dcg, and quickrank::metric::ir::Map.
|
inlinevirtual |
Computes the Jacobian matrix.
This is a symmetric matrix storing the metric "decrease" when two documents scores are swapped.
rl | A results list. |
Reimplemented in quickrank::metric::ir::Ndcg, quickrank::metric::ir::Tndcg, quickrank::metric::ir::Dcg, and quickrank::metric::ir::Map.
|
pure virtual |
Returns the name of the metric.
Implemented in quickrank::metric::ir::Ndcg, quickrank::metric::ir::Tndcg, quickrank::metric::ir::Dcg, and quickrank::metric::ir::Map.
|
privatepure virtual |
Prints the short name of the Metric, e.g., "NDCG@K".
Implemented in quickrank::metric::ir::Tndcg, quickrank::metric::ir::Ndcg, quickrank::metric::ir::Dcg, and quickrank::metric::ir::Map.
|
inline |
Updates the cut-off of the Metric.
|
friend |
The output stream operator.
|
private |
The metric cutoff.
|
static |
This should be used when no cut-off on the results list is required.