blob: d31114952a593c225e07ee5d8f23953dbdb05a4f (
plain)
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
39
40
41
42
43
44
45
|
#ifndef DATAPROV_H
#define DATAPROV_H
#include<Eigen/Dense>
#include "../tools/easylogging++.h"
#include<vector>
// TODO decide how to construct training data
// One possible way for training data:
// Matrix composed of an array of feature vectors
// Labels are composed of linked list, such as
// 6,3,4,0,5,0,0
// => 0->6 | 1->3 | 2->4->5
// How to compensate for non exhaustive labeling?
// Use -1 to indicate not yet labeled data
// -1s will be excluded from training
typedef Eigen::MatrixXd DataSet;
typedef Eigen::VectorXd Labels;
class DataProvider //Virtual base class for data input
{
protected:
int size;
int attrSize;
bool eof;
public:
DataProvider():eof(false){};
int getSize(){
return size;
}
int getAttrSize(){
return attrSize;
}
bool EOFile(){return eof;};
virtual int getDataSet(DataSet &out) = 0;
virtual int getLabel(Labels &out) = 0;
virtual int open()=0;
virtual int close()=0;
};
#endif
|