-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunDecisionTree.java
More file actions
51 lines (34 loc) · 1.47 KB
/
Copy pathRunDecisionTree.java
File metadata and controls
51 lines (34 loc) · 1.47 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
import java.util.Scanner;
/**
* Created by VenkataRamesh on 12/7/2016.
*/
public class RunDecisionTree {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Cross Validation Fold Number: ");
System.out.println("Enter a negative value for NO cross validation: ");
int foldNumber = Integer.valueOf(sc.nextLine());
System.out.println("Enter File name of data set: ");
String fileName = sc.nextLine();
if (fileName == null || fileName.length() == 0) {
fileName = "project3_dataset1.txt";
}
System.out.println("Enter File name of testing data set: ");
String testFileName = sc.nextLine();
if (testFileName == null || testFileName.length() == 0) {
testFileName = fileName;
}
String path = "data/";
DecisionTree decisionTree = new DecisionTree(foldNumber, fileName);
double[][] dataMatrix = decisionTree.readDataSet(path, fileName);
double[][] testMatrix = decisionTree.readDataSet(path, testFileName);
decisionTree.runTreeInductionAlgo(dataMatrix, testMatrix);
//double[][] distanceMatrix = KNN.calculateDistanceMatrix();
/*Arrays.stream(matrix).forEach(x -> {
System.out.println(Arrays.toString(x));
});*/
/* Arrays.stream(distanceMatrix).forEach(x -> {
System.out.println(Arrays.toString(x));
});*/
}
}