refactored train and predict methods of em

This commit is contained in:
Maria Dimashova
2012-04-17 06:29:40 +00:00
parent 8f7e5811b6
commit 3dfa917879
7 changed files with 56 additions and 65 deletions

View File

@@ -478,7 +478,7 @@ void find_decision_boundary_EM()
for(size_t modelIndex = 0; modelIndex < em_models.size(); modelIndex++)
{
if(em_models[modelIndex].isTrained())
em_models[modelIndex].predict( testSample, noArray(), &logLikelihoods.at<double>(modelIndex) );
logLikelihoods.at<double>(modelIndex) = em_models[modelIndex].predict(testSample)[0];
}
Point maxLoc;
minMaxLoc(logLikelihoods, 0, 0, 0, &maxLoc);