Search in sources :

Example 1 with NDCG_Evaluator

use of Ranker.evaluator.NDCG_Evaluator in project IR_Base by Linda-sunshine.

the class L2RMetricLearning method evaluate.

double evaluate(OptimizationType otype) {
    Evaluator eval;
    if (otype.equals(OptimizationType.OT_MAP))
        eval = new MAP_Evaluator();
    else if (otype.equals(OptimizationType.OT_NDCG))
        eval = new NDCG_Evaluator(LambdaRank.NDCG_K);
    else
        eval = new Evaluator();
    double perf = 0;
    for (_Query q : m_queries) {
        for (_QUPair qu : q.m_docList) qu.score(m_weights);
        perf += eval.eval(q);
    }
    return perf / m_queries.size();
}
Also used : structures._Query(structures._Query) structures._QUPair(structures._QUPair) MAP_Evaluator(Ranker.evaluator.MAP_Evaluator) NDCG_Evaluator(Ranker.evaluator.NDCG_Evaluator) MAP_Evaluator(Ranker.evaluator.MAP_Evaluator) NDCG_Evaluator(Ranker.evaluator.NDCG_Evaluator) Evaluator(Ranker.evaluator.Evaluator)

Aggregations

Evaluator (Ranker.evaluator.Evaluator)1 MAP_Evaluator (Ranker.evaluator.MAP_Evaluator)1 NDCG_Evaluator (Ranker.evaluator.NDCG_Evaluator)1 structures._QUPair (structures._QUPair)1 structures._Query (structures._Query)1