forked from hlamotte/decision-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecisionTree.hpp
53 lines (39 loc) · 1.24 KB
/
DecisionTree.hpp
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
#ifndef DECISIONTREE_HPP
#define DECISIONTREE_HPP
#include "CSVReader.hpp"
#include "Node.hpp"
struct TwoDataFrame
{
DataFrame pres;
DataFrame abs;
};
// instantiate the node in the heap, then don't need to explicitly allocate member
// variables memory in the heap
class DecisionTree
{
// Access specifier
public:
//at some point need to make private and expose using getters and setters
Node* rootP;
//DataFrame trainingData;
DecisionTree(std::string trainPath);
~DecisionTree();
DecisionTree* DeepCopy() {
// READ ABOUT DEEP AND SHALLOW COPIES
// copy stuff
return this;
}
DecisionTree* ShallowCopy() {
// READ ABOUT DEEP AND SHALLOW COPIES
// copy stuff
return this;
}
// Traverse tree
void traverseTree() const;
static TwoDataFrame splitData(const DataFrame& dataBefore, int feature, int category);
static void constructTree(Node* nodeP);
std::vector<int> predict(std::string path);
void deleteChildren(Node* nodeP);
static int recursivelyPredict(Node* nodeP, std::vector<int> observations);
};
#endif /* DECISIONTREE_HPP */