-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeseries.h
71 lines (49 loc) · 1.48 KB
/
timeseries.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* timeseries.h
*
* Author: 314970054 Ariel Barmats &
* 314985474 Amiram Yasif
*/
#ifndef TIMESERIES_H_
#define TIMESERIES_H_
#include <vector>
#include <string>
#include <map>
using namespace std;
class TimeSeries {
private:
map<string, int> criterion_index_map;
vector<float *> feature_guided_dataset, record_guided_dataset;
int records_count, features_count;
// Inits the data stracture
void initDataset(vector<string> &);
//switches line to float arr
float *lineToDoubleArray(string);
//Reads csv data
vector<string> GetCSVrawDataLines(const char *);
// creates list of the criteria string
void setCriteriaMap(string);
// creates matrix according to records
void setRecordGuidedDataset(vector<string> &);
// creates matrix according to features
void setFeaturesGuidedDataset();
// sets the dims of the experiment
void setDatasetDims(vector<string> &raw_dataset);
// allocates mem for the matrix
void initMatrixes();
public:
// get num of features
int getColumnsNum() const;
// get num of records
int getRowsNum() const;
// get array of data in the i'th feature
float *getFeatureArray(int) const;
// get array of data in the feature given as param
float *getFeatureArray(string) const;
// get the name of the i'th feature
string getFeatureName(int) const;
//constructor
TimeSeries(const char *CSVfileName);
void print();
};
#endif /* TIMESERIES_H_ */