Search in sources :

Example 11 with structures._QUPair

use of structures._QUPair in project IR_Base by Linda-sunshine.

the class L2RMetricLearning method normalize.

void normalize() {
    m_mean = new double[RankFVSize];
    m_std = new double[RankFVSize];
    double size = 0;
    for (_Query q : m_queries) {
        for (_QUPair qu : q.m_docList) {
            for (int i = 0; i < RankFVSize; i++) {
                m_mean[i] += qu.m_rankFv[i];
                m_std[i] += qu.m_rankFv[i] * qu.m_rankFv[i];
                size++;
            }
        }
    }
    for (int i = 0; i < RankFVSize; i++) {
        m_mean[i] /= size;
        m_std[i] = Math.sqrt(m_std[i] / size - m_mean[i] * m_mean[i]);
    }
    for (_Query q : m_queries) {
        for (_QUPair qu : q.m_docList) {
            normalize(qu.m_rankFv);
        }
    }
}
Also used : structures._Query(structures._Query) structures._QUPair(structures._QUPair)

Aggregations

structures._QUPair (structures._QUPair)11 structures._Query (structures._Query)5 ArrayList (java.util.ArrayList)2 Evaluator (Ranker.evaluator.Evaluator)1 MAP_Evaluator (Ranker.evaluator.MAP_Evaluator)1 NDCG_Evaluator (Ranker.evaluator.NDCG_Evaluator)1 HashMap (java.util.HashMap)1 MyPriorityQueue (structures.MyPriorityQueue)1 structures._Doc (structures._Doc)1 structures._RankItem (structures._RankItem)1