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 AdaBoost (const Boosting& s) : Boosting(s) {} 00026 explicit AdaBoost (std::istream& is) { is >> *this; } 00027 00028 virtual const id_t& id () const; 00029 virtual AdaBoost* create () const { return new AdaBoost(); } 00030 virtual AdaBoost* clone () const { return new AdaBoost(*this); } 00031 00032 virtual void train (); 00033 00034 protected: 00036 std::vector<REAL> cur_err; 00037 00038 virtual REAL convex_weight (const DataWgt&, const LearnModel&); 00039 virtual REAL linear_weight (const DataWgt&, const LearnModel&); 00040 virtual void linear_smpwgt (DataWgt&); 00041 }; 00042 00043 } // namespace lemga 00044 00045 #ifdef __ADABOOST_H__ 00046 #warning "This header file may conflict with another `adaboost.h' file." 00047 #endif 00048 #define __ADABOOST_H__ 00049 #endif