00001 // -*- C++ -*- 00002 #ifndef __LEMGA_AGGREGATING_CASCADE_H__ 00003 #define __LEMGA_AGGREGATING_CASCADE_H__ 00004 00011 #include <utility> 00012 #include "aggregating.h" 00013 00014 namespace lemga { 00015 00047 class Cascade : public Aggregating { 00048 protected: 00049 std::vector<REAL> upper_margin; 00050 std::vector<REAL> lower_margin; 00051 00052 public: 00053 virtual Cascade* create () const = 0; 00054 virtual Cascade* clone () const = 0; 00055 00057 virtual bool support_weighted_data () const { return true; } 00058 virtual void train () = 0; 00059 virtual Output operator() (const Input&) const; 00060 00062 virtual REAL belief (const LearnModel&, 00063 const Input&, const Output&) const; 00064 00065 protected: 00066 virtual bool serialize (std::ostream&, ver_list&) const; 00067 virtual bool unserialize (std::istream&, ver_list&, const id_t& = NIL_ID); 00068 }; 00069 00070 } // namespace lemga 00071 00072 #ifdef __CASCADE_H__ 00073 #warning "This header file may conflict with another `cascade.h' file." 00074 #endif 00075 #define __CASCADE_H__ 00076 #endif