-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathFeatureVector.h
More file actions
37 lines (28 loc) · 793 Bytes
/
FeatureVector.h
File metadata and controls
37 lines (28 loc) · 793 Bytes
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
#ifndef _FEATURE_VECTOR_H
#define _FEATURE_VECTOR_H
#include <vector>
static const int POS = 1;
static const int NEG = -1;
/**********************************
* Class: FeatureVector
* --------------------
* Feature vectors have a value, weight, and vector of features (floats) that
* can be compared with other feature vectors
*/
class FeatureVector {
public:
FeatureVector(const std::vector<float> &in_vec,
int in_val); // constructor
FeatureVector(const FeatureVector &other);
unsigned int size() const;
int val() const;
float weight() const;
float at(unsigned int i) const;
void setWeight(float weight);
void printFeature() const;
private:
std::vector <float> fvec; // feature vector
int value; // value (POS or NEG)
float wt; // weight
};
#endif