degate  0.1.2
Classes | Functions
adaboost.hpp File Reference
#include <vector>
#include <string>
#include <math.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Classifier< T >
class  MultiClassifier< T >

Functions

template<class T >
void testClassifier (Classifier< T > *cls, vector< T * > data, vector< int > label, float &fpos, float &fneg)

Function Documentation

template<class T >
void testClassifier ( Classifier< T > *  cls,
vector< T * >  data,
vector< int >  label,
float &  fpos,
float &  fneg 
)

Definition at line 132 of file adaboost.hpp.

References Classifier< T >::recognize().

{
        int pos = 0, neg = 0;
        fpos=fneg=0;
        for (int i=0;i<label.size();i++)
        {
                int rec = cls->recognize(*data[i]);
                if (label[i]==1)
                {
                        pos++;
                        if (rec!=1)
                                fneg=fneg+1;
                }
                if (label[i]==-1)
                {
                        neg++;
                        if (rec!=-1)
                                fpos=fpos+1;
                }
        }
        fpos = fpos/neg;
        fneg = fneg/pos;
}

Here is the call graph for this function: