Definition at line 67 of file SearchResult.h. References Impala::Core::Trec::SearchJudge::GetNrRelevant(), Impala::Core::Trec::SearchJudge::Judge(), mAp, mHits, mJudgement, mPrecision, mShot, mTopic, Impala::Application::DemoCamera2d::precision, and Impala::Application::DemoCamera2d::verbose. Referenced by Impala::Visualization::SearchJudgeGui::DoJudgement(), and Impala::Application::WindowTrecResult::WindowTrecResult(). 00068 { 00069 mJudgement.clear(); 00070 mHits.clear(); 00071 mPrecision.clear(); 00072 int nrRelevant = theJudge->GetNrRelevant(mTopic); 00073 int hits = 0; 00074 double accumPrecision = 0; 00075 for (int i=0 ; i<mShot.size() ; i++) 00076 { 00077 int judgement = theJudge->Judge(mTopic, mShot[i]); 00078 int nr = i+1; 00079 if (judgement == 1) 00080 { 00081 if (verbose && (nr <= 10)) 00082 std::cout << " Hit at " << nr << std::endl; 00083 hits++; 00084 accumPrecision += (double) hits / nr; 00085 } 00086 double precision = (double) hits / nr; 00087 if (verbose && (nr == 10)) 00088 std::cout << "Hits at 10 : " << hits << ", precision : " 00089 << precision << std::endl; 00090 if (verbose && (nr == 30)) 00091 std::cout << "Hits at 30 : " << hits << ", precision : " 00092 << precision << std::endl; 00093 if (verbose && (nr == 100)) 00094 std::cout << "Hits at 100 : " << hits << ", precision : " 00095 << precision << std::endl; 00096 if (verbose && (nr == 1000)) 00097 std::cout << "Hits at 1000 : " << hits << ", precision : " 00098 << precision << std::endl; 00099 mJudgement.push_back(judgement); 00100 mHits.push_back(hits); 00101 mPrecision.push_back(precision); 00102 } 00103 mAp = accumPrecision / nrRelevant; 00104 if (verbose) 00105 std::cout << "average precision : " << mAp << std::endl; 00106 }
Here is the call graph for this function:
|