degate  0.1.2
Public Member Functions | Public Attributes | Private Attributes
MultiClassifier< T > Class Template Reference

#include <adaboost.hpp>

Inheritance diagram for MultiClassifier< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MultiClassifier (vector< float > w, vector< Classifier< T > * > c)
std::string get_name () const
int recognize (T &obj)

Public Attributes

float score

Private Attributes

vector< float > weights
vector< Classifier< T > * > clsfrs

Detailed Description

template<class T>
class MultiClassifier< T >

Definition at line 103 of file adaboost.hpp.


Constructor & Destructor Documentation

template<class T >
MultiClassifier< T >::MultiClassifier ( vector< float >  w,
vector< Classifier< T > * >  c 
) [inline]

Definition at line 110 of file adaboost.hpp.

        {       
                this->weights = w;
                this->clsfrs = c;
        }

Member Function Documentation

template<class T >
std::string MultiClassifier< T >::get_name ( ) const [inline, virtual]

Implements Classifier< T >.

Definition at line 115 of file adaboost.hpp.

{ return "MultiClassifier"; }
template<class T >
int MultiClassifier< T >::recognize ( T &  obj) [inline, virtual]

Implements Classifier< T >.

Definition at line 116 of file adaboost.hpp.

        {
                float res=0;
                for (unsigned int i=0;i<weights.size();i++)
                  if(weights[i]> 0) res+=weights[i]*clsfrs[i]->recognize(obj);
                score=res;
                if (res>=0) 
                        return 1;
                else
                        return -1;
        }

Member Data Documentation

template<class T >
vector<Classifier<T>*> MultiClassifier< T >::clsfrs [private]

Definition at line 107 of file adaboost.hpp.

template<class T >
float MultiClassifier< T >::score

Definition at line 109 of file adaboost.hpp.

template<class T >
vector<float> MultiClassifier< T >::weights [private]

Definition at line 106 of file adaboost.hpp.


The documentation for this class was generated from the following file: