29 #include "Traits/HaarFeature.h"
31 template<
class WeakClassifier>
39 template<
class WeakClassifier>
52 template<
class DataSetType>
53 static bool Update(
const WeakClassifier & H, DataSetType & training_set, DataSetType & validation_set,
bool verbose=
true)
66 for(
unsigned int i=0; i<validation_set.Size(); i++)
68 double f = H.classify( getData1(validation_set.templates[i], validation_set), getData2(validation_set.templates[i], validation_set) );
69 double u = validation_set.templates[i].category * f;
73 if(validation_set.templates[i].category == +1)
75 wP += validation_set.templates[i].d;
78 wTP += validation_set.templates[i].d;
85 wN += validation_set.templates[i].d;
88 wTN += validation_set.templates[i].d;
97 validation_set.templates[i].d *= exp( - u );
99 z+= validation_set.templates[i].d;
106 for(
typename DataSetType::ListType::iterator i = validation_set.templates.begin(); i != validation_set.templates.end(); ++i)
111 std::cout <<
"Best Feature | Z = " << z <<
" | Correct In Number = " << (TP+TN) * 100 / validation_set.Size() <<
"% (" << 100*TP/P <<
"% +, " << 100 * TN/N <<
"% -)" <<
112 " | Correct in Weight = " << (int)( (wTP+wTN) * 100 / (wP+wN)) <<
"% (" << (int)(100 * wTP/wP) <<
"% +, " << (int)(100 * wTN/wN) <<
"% -)" <<
a file containing misc type
static bool Update(const WeakClassifier &H, DataSetType &training_set, DataSetType &validation_set, bool verbose=true)
Definition: AdaBoost.h:53
Definition: AdaBoost.h:32