-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecisionTreeApp.java
More file actions
53 lines (25 loc) · 1.09 KB
/
Copy pathDecisionTreeApp.java
File metadata and controls
53 lines (25 loc) · 1.09 KB
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
package decisiontree;
import java.io.*;
class DecisionTreeApp {
static BufferedReader keyboardInput = new
BufferedReader(new InputStreamReader(System.in));
static DecisionTree newTree;
public static void main(String[] args) throws IOException {
newTree = new DecisionTree();
generateTree();
System.out.println("\nOUTPUT DECISION TREE");
System.out.println("====================");
newTree.outputBinTree();
}
static void generateTree() {
System.out.println("\nGENERATE DECISION TREE");
System.out.println("======================");
newTree.createRoot(1,"Does animal eat meat?");
newTree.addYesNode(1,2,"Does animal have stripes?");
newTree.addNoNode(1,3,"Does animal have stripes?");
newTree.addYesNode(2,4,"Animal is a Tiger");
newTree.addNoNode(2,5,"Animal is a Leopard");
newTree.addYesNode(3,6,"Animal is a Zebra");
newTree.addNoNode(3,7,"Animal is a Horse");
}
}