Package edu.msu.cme.rdp.classifier.io

Examples of edu.msu.cme.rdp.classifier.io.TreeFileParser


        if (!(isProbIndexArrDone || isGenusWordProbListDone || isWordPriorArrDone)) {
            throw new IllegalStateException("Error: The bergeyTree file should be read after "
                    + "at least one of the other training files");
        }

        TreeFileParser parser = new TreeFileParser();
        rootTree = parser.createTree(reader, hierarchyVersion);

        createGenusNodeList(rootTree);

        logLeaveCountArr = new float[genusNodeList.size()];

        for (HierarchyTree node : genusNodeList) {
            logLeaveCountArr[node.getGenusIndex()] = (float) Math.log(node.getLeaveCount() + 1);
        }
        this.trainRank = parser.getTrainRank();
        isTreeDone = true;
    }
View Full Code Here


  }
 
  /** Test of parseTreeFile method, of class classification.TrainingFileParser. */
  public void testParseTreeFile() throws Exception{
    System.out.println("testParseTreeFile");
    TreeFileParser parser = new TreeFileParser();
    InputStream dstream = System.class.getResourceAsStream("/test/classifier/testTreeFile.xml");
    HierarchyVersion hVersion = null;
   
    Reader in =  new InputStreamReader( dstream );
    HierarchyTree root = parser.createTree(in, null);
    assertEquals(root.getName(), "BACTERIA");
    assertEquals(root.getLeaveCount(), 4123);
    assertEquals(root.getSizeofSubclasses(), 3);
    //displayTrainingTree(root);
   
View Full Code Here

TOP

Related Classes of edu.msu.cme.rdp.classifier.io.TreeFileParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.