LPBoost.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _LPBOOST_H___
00012 #define _LPBOOST_H___
00013
00014 #include "lib/config.h"
00015 #ifdef USE_CPLEX
00016
00017 #include <stdio.h>
00018 #include "lib/common.h"
00019 #include "lib/DynamicArray.h"
00020
00021 #include "features/Features.h"
00022 #include "classifier/SparseLinearClassifier.h"
00023
00024 class CLPBoost : public CSparseLinearClassifier
00025 {
00026 public:
00027 CLPBoost();
00028 virtual ~CLPBoost();
00029
00030 virtual bool train();
00031
00032 inline virtual EClassifierType get_classifier_type()
00033 {
00034 return CT_LPBOOST;
00035 }
00036
00037 bool init(INT num_vec);
00038 void cleanup();
00039
00040 inline void set_C(DREAL c1, DREAL c2) { C1=c1; C2=c2; }
00041
00042 inline DREAL get_C1() { return C1; }
00043 inline DREAL get_C2() { return C2; }
00044
00045 inline void set_bias_enabled(bool enable_bias) { use_bias=enable_bias; }
00046 inline bool get_bias_enabled() { return use_bias; }
00047
00048 inline void set_epsilon(DREAL eps) { epsilon=eps; }
00049 inline DREAL get_epsilon() { return epsilon; }
00050
00051 DREAL find_max_violator(INT& max_dim);
00052
00053 protected:
00054 DREAL C1;
00055 DREAL C2;
00056 bool use_bias;
00057 DREAL epsilon;
00058
00059 DREAL* u;
00060 CDynamicArray<INT>* dim;
00061
00062 INT num_sfeat;
00063 INT num_svec;
00064 TSparse<DREAL>* sfeat;
00065
00066 };
00067 #endif //USE_CPLEX
00068 #endif //_LPBOOST_H___