Package edu.msu.cme.rdp.classifier

Examples of edu.msu.cme.rdp.classifier.GenusWordConditionalProb


                throw new TrainingDataException("\nError: " + line + " does not have exact two numbers");
            }
            try {
                int genusIndex = Integer.parseInt(st.nextToken());
                float prob = Float.parseFloat(st.nextToken());
                GenusWordConditionalProb genusProb = new GenusWordConditionalProb(genusIndex, prob);
                aList.add(genusProb);
            } catch (NumberFormatException e) {
                reader.close();
                throw new TrainingDataException("\nError: "
                        + "The value for genusIndex or word conditional probability is not a number at line : " + line);
View Full Code Here


        System.out.println("testCreateGenusWordConditionalProbList");
        InputStream dstream = System.class.getResourceAsStream("/test/classifier/testGenus_probList.txt");
        Reader in =  new InputStreamReader( dstream );
        TrainingInfo train = new TrainingInfo();
        train.createGenusWordProbList(in);
        GenusWordConditionalProb gProb = train.getWordConditionalProbObject(8);
        int genusIndex = gProb.getGenusIndex();
        float prob = gProb.getProbability();
        assertEquals(genusIndex, 4);
        assertEquals(prob, -0.15, 0.1);
       
        gProb = train.getWordConditionalProbObject(1865);
        genusIndex = gProb.getGenusIndex();
        prob = gProb.getProbability();
        assertEquals(genusIndex, 0);
        assertEquals(prob, -0.5, 0.1);
       
    }
View Full Code Here

TOP

Related Classes of edu.msu.cme.rdp.classifier.GenusWordConditionalProb

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.