00001 // -*- C++ -*- 00002 #ifndef __LEMGA_AGGREGATING_ADABOOST_H__ 00003 #define __LEMGA_AGGREGATING_ADABOOST_H__ 00004 00011 #include "boosting.h" 00012 00013 namespace lemga { 00014 00021 class AdaBoost : public Boosting { 00022 public: 00023 explicit AdaBoost (bool cvx = false, const cost::Cost& c = cost::_cost) 00024 : Boosting(cvx, c) {} 00025 explicit AdaBoost (std::istream& is) { is >> *this; } 00026 00027 virtual const id_t& id () const; 00028 virtual AdaBoost* create () const { return new AdaBoost(); } 00029 virtual AdaBoost* clone () const { return new AdaBoost(*this); } 00030 00031 virtual REAL train (); 00032 00033 protected: 00035 std::vector<REAL> cur_err; 00036 00037 virtual REAL convex_weight (const DataWgt&, const LearnModel&); 00038 virtual REAL linear_weight (const DataWgt&, const LearnModel&); 00039 virtual void linear_smpwgt (DataWgt&); 00040 }; 00041 00042 } // namespace lemga 00043 00044 #ifdef __ADABOOST_H__ 00045 #warning "This header file may conflict with another `adaboost.h' file." 00046 #endif 00047 #define __ADABOOST_H__ 00048 #endif