forked from jaduzzy/DecisionTree_C_plus_plus_Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructures.h
More file actions
40 lines (31 loc) · 626 Bytes
/
structures.h
File metadata and controls
40 lines (31 loc) · 626 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
38
39
40
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class Node {
public:
bool isleaf = false;
size_t label;
double attrValue;
vector<Node> children;
int col = -1;
double gini;
size_t n_samples;
map <int, int> class_count;
vector<vector<double>> data;
};
struct Ginis {
double gini_left, gini_right, gini_left_nonstand, gini_right_nonstand;
};
struct MajorLabel {
size_t major;
std::map <int, int> class_count;
};
struct SplitInfo {
int idx;
double value, gini, gini_left, gini_right;;
};
struct DataSplits {
std::vector<std::vector<double>> data_left, data_right;
};