forked from 20020001-UET/dsa-decision-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStump.h
51 lines (37 loc) · 970 Bytes
/
Stump.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
/**
* This file is part of dsa-decision-tree
*
* Developed for the DSA UET course.
* This project was developed by Ba Luong and Gia Linh.
*/
#pragma once
#ifndef STUMP_H
#define STUMP_H
#include "Node.h"
class Stump : virtual public Node
{
private:
double significance;
int attribute;
int compareValue;
SplitData::SPLIT_VAL method;
public:
Stump(int attribute, int compareValue, SplitData::SPLIT_VAL method, double _significance);
//is Terminal Node
bool isTerminal();
//compare to the data
bool compare(Data *data);
//get the significance
double getSignificance();
//get the label
char getLabel();
//toString method
string toString();
//prediction method with attribute return the label predicted
char predict(vector<int> attribute);
//check if prediction is correct
bool predict(Node *node, Data *data);
void setCode(int _code);
string getExport();
};
#endif