Definition at line 126 of file SearchJudge.h. References GetNrRelevant(), and Judge(). 00127 { 00128 int unjudged = 0; 00129 int nonRel = 0; 00130 int rel = 0; 00131 Real64 infAP = 0; 00132 Real64 apAdd = 0; 00133 for (int s=0 ; s<shots.size() ; s++) 00134 { 00135 switch (Judge(topic, shots[s])) 00136 { 00137 case -1: 00138 unjudged++; 00139 break; 00140 case 0: 00141 nonRel++; 00142 break; 00143 case 1: 00144 rel++; 00145 if (s == 0) 00146 { 00147 infAP += 1; 00148 } 00149 else 00150 { 00151 Real64 k = s + 1; 00152 Real64 relMin = rel - 1; 00153 Real64 d = relMin + nonRel + unjudged; 00154 Real64 eps = 0.00001; 00155 apAdd = 1.0 / k + ((k-1) / k) * 00156 (d / (k-1)) * ((relMin + eps) / (relMin + nonRel + 2*eps)); 00157 //std::cout << "apAdd = " << apAdd 00158 // << ", rel = " << rel << ", d = " << d << std::endl; 00159 infAP += apAdd; 00160 } 00161 break; 00162 } 00163 } 00164 infAP /= GetNrRelevant(topic); 00165 return infAP; 00166 }
Here is the call graph for this function:
|