-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathResults.java
41 lines (36 loc) · 982 Bytes
/
Results.java
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
package decisiontree;
import java.util.*;
public class Results {
private LinkedList<Test> testSets;
public Results(){
//init
testSets = new LinkedList<Test>();
}
public void addTest(Test test){
testSets.add(test);
}
public List<Test> getTests(){
return testSets;
}
public double predictability(){
double predictabilityRate =0;
for(Test t : testSets){
predictabilityRate +=t.ratio();
}
return predictabilityRate*10;
}
@Override
public String toString(){
String newline = System.getProperty("line.separator");
String results="";
int totalPos = 0;
int totalNeg = 0;
for(Test t : testSets){
totalPos+=t.getPos();
totalNeg+=t.getNeg();
results+="["+t.getPos()+" - "+t.getNeg()+"]";
}
results+=newline+" Final Count: Positive = "+totalPos+" Negative = "+totalNeg;
return results;
}
}