train.createLogWordPriorArr(in);
int genusNodeListSize = train.getGenusNodeListSize();
assertEquals(genusNodeListSize, 6);
HierarchyTree genusNode = train.getGenusNodebyIndex(3);
assertEquals(genusNode.getGenusIndex(), 3);
assertEquals(genusNode.getName(), "Pseudomonas");
int leaveCount = genusNode.getLeaveCount();
float logLeaveCount = train.getLogLeaveCount(1);
assertEquals((double)leaveCount, Math.exp(logLeaveCount) -1, 0.1);
HierarchyTree rootTree = train.getRootTree();
assertEquals(rootTree.getName(), "Bacteria");
assertNotNull( rootTree.getSubclasses());
Classifier aClassifier = train.createClassifier();
//test addConfidence()
HashMap<HierarchyTree, RankAssignment> determinedMap = new HashMap <HierarchyTree, RankAssignment>();
HierarchyTree determinedGenusNode = train.getGenusNodebyIndex(4);
HierarchyTree Enterobacteriales = determinedGenusNode.getParent().getParent();
HierarchyTree Gammaproteobacteria = Enterobacteriales.getParent();
HierarchyTree aNode = determinedGenusNode;
while (aNode != null){
determinedMap.put(aNode, new RankAssignment(aNode, 0));
aNode = aNode.getParent();
}
HierarchyTree bestNode = train.getGenusNodebyIndex(1); // Vibrio
aClassifier.addConfidence(bestNode, determinedMap);
assertEquals( determinedMap.get(determinedGenusNode).getConfidence(), 0.0f, 0.0001); //Enterobacter
assertEquals( determinedMap.get(Enterobacteriales).getConfidence(), 0.0f, 0.0001); //Enterobacteriales
assertEquals( determinedMap.get(Gammaproteobacteria).getConfidence(), 1.0f, 0.0001); //Gammaproteobacteria