1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include "objrec-froehlichexp/classifier/FPCnone.h"
- #include <iostream>
- using namespace OBJREC;
- using namespace std;
- using namespace NICE;
- FPCnone::FPCnone ()
- {
- }
- FPCnone::FPCnone( const Config *_conf, string section )
- {
- conf = _conf;
- }
- FPCnone::~FPCnone()
- {
-
- }
- ClassificationResult FPCnone::classify ( Example & pce )
- {
- FullVector overall_distribution(maxClassNo+1);
- overall_distribution[maxClassNo] = 0.0;
- double maxp = -numeric_limits<double>::max();
- int classno = 0;
-
- double sum = 0.0;
-
- for(int i = 0; i < maxClassNo; i++)
- {
- overall_distribution[i] = (*pce.vec)[i];
-
- sum += overall_distribution[i];
- if(maxp < overall_distribution[i])
- {
- classno = i;
- maxp = overall_distribution[i];
- }
- }
-
-
- cout << "Klasse: " << classno << " prob: " << overall_distribution[classno] << endl;
- return ClassificationResult ( classno, overall_distribution );
- }
- void FPCnone::train ( FeaturePool & _fp, Examples & examples )
- {
- fp = FeaturePool(_fp);
- }
- void FPCnone::restore (istream & is, int format)
- {
- }
- void FPCnone::store (ostream & os, int format) const
- {
- }
- void FPCnone::clear ()
- {
- }
- FeaturePoolClassifier *FPCnone::clone () const
- {
- FPCnone *o = new FPCnone ( conf, "non" );
- o->maxClassNo = maxClassNo;
- return o;
- }
- void FPCnone::setComplexity ( int size )
- {
- cerr << "FPCnone: no complexity to set" << endl;
- }
|