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);
}
}
}
Aggregations