forked from astromme/AdaBoost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeakClassifier.h
38 lines (30 loc) · 880 Bytes
/
WeakClassifier.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _WEAK_CLASSIFIER_H
#define _WEAK_CLASSIFIER_H
#include <string>
#include <vector>
const int ZERO = 0;
/******************************
* Class: WeakClassifier
* ---------------------
* Weak classifiers have a threshold and a flipped boolean which together tell
* us if the WeakClassifier correctly classified a feature. It also has a
* weight.
*/
class WeakClassifier {
public:
WeakClassifier(unsigned int in_dim, float in_thresh,bool in_flip, float in_wt) :
dim(in_dim), thresh(in_thresh), flipped(in_flip), wt(in_wt) {}; // constructor
int dimension() const;
float weight() const;
float threshold() const;
bool isFlipped() const;
// Output
void printClassifier() const;
void writeClassifier(std::string fname) const;
private:
unsigned int dim; // dimension
float thresh; // threshold
bool flipped;
float wt; // weight
};
#endif