Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

Table::ScoreTable* Impala::Core::Training::ApplyConceptsHelperFik::Predict ( const ModelLocator loc  )  [inline, virtual]

Implements Impala::Core::Training::ApplyConceptsHelper.

Definition at line 67 of file ApplyConceptsHelperFik.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::Core::Training::FikSvm::Apply(), Impala::Core::Training::FikSvm::GetRho(), Impala::Core::Feature::WeightedFeatureList::GetTotalWeight(), Impala::Core::Feature::WeightedFeatureList::GetWeight(), mFeatureDefs, mFeatures, mModels, Impala::Core::Training::FikSvm::PredictProbability(), Impala::Core::Feature::WeightedFeatureList::Size(), and Impala::Persistency::ModelLocator::ToString().

00068     {
00069         FikSvm* svm = 0;
00070         if (!mModels.Get(loc.ToString(), svm))
00071         {
00072             svm = Persistency::FikSvmRepository().Get(loc);
00073             mModels.Add(loc.ToString(), svm);
00074         }
00075 
00076         Table::ScoreTable* scores = new Table::ScoreTable();
00077         int nrVec = mFeatures[0]->Size();
00078         for (int v=0 ; v<nrVec ; v++)
00079         {
00080             Real64 score = 0;
00081             for (int f=0 ; f<mFeatureDefs.Size() ; f++)
00082             {
00083                 FeatureTable::VectorReal64 vec = mFeatures[f]->Get2(v);
00084                 Real64 subScore = svm->Apply(f, vec);
00085                 subScore += svm->GetRho(); // correct for incremental feature
00086                 subScore *= mFeatureDefs.GetWeight(f);
00087                 score += subScore;
00088             }
00089             score /= mFeatureDefs.GetTotalWeight();
00090             score -= svm->GetRho(); // correct for incremental feature
00091 
00092             score = svm->PredictProbability(score);
00093             scores->Add(mFeatures[0]->Get1(v), score);
00094         }
00095         return scores;
00096     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:21:11 2011 for ImpalaSrc by  doxygen 1.5.1