forked from astromme/AdaBoost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrainingData.h
38 lines (28 loc) · 888 Bytes
/
TrainingData.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 _TRAINING_DATA_H
#define _TRAINING_DATA_H
#include <vector>
#include <string>
#include "FeatureVector.h"
class TrainingData {
public:
TrainingData() :
num_dimensions(0) {}; // constructor
TrainingData(const TrainingData &other);
TrainingData shuffled() const;
bool addFeature(FeatureVector in_ftr);
FeatureVector removeFeatureAt(int location);
unsigned int size() const;
unsigned int dimensions() const;
int val(unsigned int i) const;
float weight(unsigned int i) const;
float at(unsigned int idx, unsigned int dimension) const;
FeatureVector* feature(unsigned int idx) const;
void setWeight(unsigned int idx, float weight);
// Output
void printData();
void writeData(std::string filename);
private:
std::vector <FeatureVector> data; // set of feature vectors
unsigned int num_dimensions; // size of each feature vector
};
#endif