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

virtual void Impala::Core::Training::Svm::Train ( Util::PropertySet properties,
TrainDataSrc data 
) [inline, virtual]

Implements Impala::Core::Training::Classifier.

Definition at line 67 of file Svm.h.

References Impala::Util::PropertySet::Add(), Impala::Core::Training::TrainDataSrc::FreeProblem(), Impala::Util::PropertySet::GetBool(), Impala::Core::Training::TrainDataSrc::GetTotalNegativeCount(), Impala::Core::Training::TrainDataSrc::GetTotalPositiveCount(), Impala::Core::Training::TrainDataSrc::GetVectorLength(), ILOG_DEBUG, Impala::Core::Training::TrainDataSrc::MakeSvmProblem(), SetModel(), and svm_train().

Referenced by Impala::Application::LearnConceptFromAnnotations().

00068     {
00069         if(properties->GetBool("autoweight"))
00070         {
00071             double pos = data->GetTotalPositiveCount();
00072             double neg = data->GetTotalNegativeCount();
00073             double posweight = (pos+neg) / pos;
00074             double negweight = (pos+neg) / neg;
00075             properties->Add("w1", posweight);
00076             properties->Add("w2", negweight);
00077             ILOG_DEBUG("autoweight: w+1=" << posweight << " w-1= " << negweight);
00078         }
00079         svm_parameter* parameters = 
00080             MakeSvmParams(properties, data->GetVectorLength(), 0);
00081         svm_problem* p = data->MakeSvmProblem();
00082         ILOG_DEBUG_NODE("svm_train called with problem size = " << p->l);
00083         svm_model* model = svm_train(p, parameters);
00084         FixModelDependency(model);
00085         data->FreeProblem(p);
00086         DestroySvmParameters(parameters);
00087         SetModel(model);
00088     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:23:57 2010 for ImpalaSrc by  doxygen 1.5.1