MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / evaluate

Method evaluate

src/openms/source/ANALYSIS/ID/HiddenMarkovModel.cpp:623–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621 }
622
623 void HiddenMarkovModel::evaluate()
624 {
625 for (std::map<HMMState *, std::map<HMMState *, double> >::const_iterator it1 = count_trans_.begin(); it1 != count_trans_.end(); ++it1)
626 {
627#ifdef EVALUATE_DEBUG
628 cerr << it1->first->getName() << endl;
629#endif
630 double sum(0);
631 for (std::map<HMMState *, double>::const_iterator it2 = it1->second.begin(); it2 != it1->second.end(); ++it2)
632 {
633 if (count_trans_.find(it1->first) != count_trans_.end() &&
634 count_trans_[it1->first].find(it2->first) != count_trans_[it1->first].end())
635 {
636 sum += count_trans_[it1->first][it2->first];
637#ifdef EVALUATE_DEBUG
638 cerr << it1->first->getName() << " " << it2->first->getName() << " ";
639
640 //<< count_trans_[it1->first][it2->first] << endl;
641 for (vector<double>::const_iterator it = train_count_trans_all_[it1->first][it2->first].begin(); it != train_count_trans_all_[it1->first][it2->first].end(); ++it)
642 {
643 cerr << *it << " ";
644 }
645 vector<double> data = train_count_trans_all_[it1->first][it2->first];
646 std::sort(data.begin(), data.end());
647 double mean = Math::mean(data.begin(), data.end());
648 double variance = Math::variance(data.begin(), data.end(), mean);
649 cerr << "mean=" << mean << ", variance=" << variance << endl;
650#endif
651 }
652 }
653
654 if (sum != 0)
655 {
656 for (std::map<HMMState *, double>::const_iterator it2 = it1->second.begin(); it2 != it1->second.end(); ++it2)
657 {
658 if (count_trans_.find(it1->first) != count_trans_.end() &&
659 count_trans_[it1->first].find(it2->first) != count_trans_[it1->first].end())
660 {
661 trans_[it1->first][it2->first] = count_trans_[it1->first][it2->first] / sum;
662 }
663 }
664 }
665 }
666 }
667
668 void HiddenMarkovModel::setInitialTransitionProbability(const String & state, double prob)
669 {

Callers 5

applyTransformationsMethod · 0.45
evalMethod · 0.45
fitElutionModelsMethod · 0.45
testTransformationModelsFunction · 0.45

Calls 7

sortFunction · 0.85
meanFunction · 0.50
varianceFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
findMethod · 0.45

Tested by 1

testTransformationModelsFunction · 0.36