41 std::transform(metric.begin(), metric.end(),
42 metric.begin(), ::toupper);
44 return std::shared_ptr<Metric>(
new Dcg(cutoff));
46 return std::shared_ptr<Metric>(
new Ndcg(cutoff));
48 return std::shared_ptr<Metric>(
new Tndcg(cutoff));
50 return std::shared_ptr<Metric>(
new Map(cutoff));
52 return std::shared_ptr<Metric>();
Definition: dataset.cc:28
std::shared_ptr< Metric > ir_metric_factory(std::string metric, size_t cutoff)
Definition: metric_factory.h:39
static const std::string NAME_
Definition: tndcg.h:51
This class implements the average precision AP@k measure.
Definition: map.h:36
This class implements the Normalized Discounted cumulative Gain NDCG@k measure.
Definition: ndcg.h:38
This class implements a Tie-aware version of Normalized Discounted Cumulative Gain TNDCG@k measure...
Definition: tndcg.h:38
static const std::string NAME_
Definition: ndcg.h:51
static const std::string NAME_
Definition: dcg.h:50
static const std::string NAME_
Definition: map.h:49
This class implements the Discounted cumulative Gain DCG@K measure.
Definition: dcg.h:37