Examples of Classifier


Examples of OntoUML.Classifier

     * <!-- end-user-doc -->
     * @generated NOT
     */
    private void updateContents() {
      CollectiveEditPart editpart = CollectiveEditPart.this;
      Classifier element = (Classifier) editpart.resolveSemanticElement();
      if (updateFaceIsExtensional((Collective) element)) {
        fFigureCollectiveMetaAttributeLabelFigure
            .setText("{extensional}");
        setIsEssentialTrue((Collective) element);
      } else {
        fFigureCollectiveMetaAttributeLabelFigure.setText("");
      }
      this.add(fFigureCollectiveMetaAttributeLabelFigure);

      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.CollectiveAttributeCompartmentEditPart.VISUAL_ID));
      if (compartmentEditPart != null) {
        if (element.getAttribute().size() == 0)
          ((View) compartmentEditPart.getModel()).setVisible(false);
        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
View Full Code Here

Examples of OntoUML.Classifier

     * <!-- end-user-doc -->
     * @generated NOT
     */
    private void updateContents() {
      RoleMixinEditPart editpart = RoleMixinEditPart.this;
      Classifier element = (Classifier) editpart.resolveSemanticElement();
      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.RoleMixinAttributeCompartmentEditPart.VISUAL_ID));
      if (compartmentEditPart != null) {
        if (element.getAttribute().size() == 0)
          ((View) compartmentEditPart.getModel()).setVisible(false);
        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
View Full Code Here

Examples of cc.mallet.classify.Classifier

        f++;
        InstanceList[] fold = cvIter.nextSplit();

        logger.info("Training token classifier on cv fold " + f + " / " + m_numCV + " (size=" + fold[0].size() + ")...");
       
        Classifier foldClassifier = m_trainer.train(fold[0]);
        Trial t1 = new Trial(foldClassifier, fold[0]);
        Trial t2 = new Trial(foldClassifier, fold[1]);

        logger.info("Within-fold accuracy = " + t1.getAccuracy());
        logger.info("Out-of-fold accuracy = " + t2.getAccuracy());
View Full Code Here

Examples of cc.mallet.classify.Classifier

      Object instName = instance.getName();
     
      if (! useOutOfFold || ! m_table.containsKey(instName))
        return m_tokenClassifier.classify(instance);
     
      Classifier classifier = (Classifier) m_table.get(instName);

      return classifier.classify(instance);
    }
View Full Code Here

Examples of cc.mallet.classify.Classifier

    Pipe clusterPipe = new OverlappingFeaturePipe();
    System.err.println("Training with " + training);
    InstanceList trainList = new InstanceList(clusterPipe);
    trainList.addThruPipe(new ClusterSampleIterator(training, random, 0.5, 100));
    System.err.println("Created " + trainList.size() + " instances.");
    Classifier me = new MaxEntTrainer().train(trainList);
    ClassifyingNeighborEvaluator eval =
      new ClassifyingNeighborEvaluator(me, "YES");
                                          
    Trial trial = new Trial(me, trainList);
    System.err.println(new ConfusionMatrix(trial));
View Full Code Here

Examples of cc.mallet.classify.Classifier

          trainingInstances.add(pipe.pipe(inst));
        }
      }
      logger.info("generated " + trainingInstances.size()
          + " training instances");
      Classifier classifier = new MaxEntTrainer().train(trainingInstances);
      logger.info("InfoGain:\n");
      new InfoGain(trainingInstances).printByRank(System.out);
      logger.info("pairwise training accuracy="
          + new Trial(classifier, trainingInstances).getAccuracy());
      NeighborEvaluator neval = new PairwiseEvaluator(classifier, "YES",
View Full Code Here

Examples of common.inspect.Classifier

   
@Override
public Classifier getClassifierForTF(String tf)throws Exception{
    tf= tf.toUpperCase();
    final int col= idCol.get(tf);
    Classifier ret= new HClassifier(tf, col);
    return ret;
}
View Full Code Here

Examples of common.inspect.Classifier

}

public Classifier getClassifierForTF(String tf)throws Exception{
    tf= tf.toUpperCase();
    final int col= idCol.get(tf);
    Classifier ret= new HClassifier(tf, col);
    return ret;
}
View Full Code Here

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

        FileInputStream inStream1 = new FileInputStream(s1);
        FileInputStream inStream2 = new FileInputStream(s2);
        BufferedWriter wt = new BufferedWriter(new FileWriter(detailFile));


        Classifier aClassifier = factory.createClassifier();
        TaxonTree root = null;
        SequenceReader parser = null;
        Sequence pSeq = null;
        int count = 0;

        try {
            parser = new SequenceReader(inStream1);
            while((pSeq = parser.readNextSequence()) != null) {
                try {
                    ClassificationResult result = aClassifier.classify(pSeq);
                    root = reconstructTree(result, root, SAMPLE1);
                    wt.write(ClassificationResultFormatter.getOutput(result, format));

                } catch (ShortSequenceException e) {
                    System.out.println(e.getMessage());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            parser = new SequenceReader(inStream2);
            while((pSeq = parser.readNextSequence()) != null) {
                try {
                    ClassificationResult result = aClassifier.classify(pSeq);
                    root = reconstructTree(result, root, SAMPLE2);
                    wt.write(ClassificationResultFormatter.getOutput(result, format));

                } catch (ShortSequenceException e) {
                    System.out.println(e.getMessage());
View Full Code Here

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

       
        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
       
    bestNode = train.getGenusNodebyIndex(4);   //Enterobacter
    aClassifier.addConfidence(bestNode, determinedMap);
    assertEquals( determinedMap.get(determinedGenusNode).getConfidence(), 1.0f, 0.0001)//Enterobacter
    assertEquals( determinedMap.get(Enterobacteriales).getConfidence(), 1.0f, 0.0001)//Enterobacteriales
    assertEquals( determinedMap.get(Gammaproteobacteria).getConfidence(), 2.0f, 0.0001)//Gammaproteobacteria
   
    aClassifier.addConfidence(train.getGenusNodebyIndex(4), determinedMap)//Enterobacter
    aClassifier.addConfidence(train.getGenusNodebyIndex(0), determinedMap)//Clostridium
    assertEquals( determinedMap.get(determinedGenusNode).getConfidence(), 2.0f, 0.0001)//Enterobacter
    assertEquals( determinedMap.get(Enterobacteriales).getConfidence(), 2.0f, 0.0001)//Enterobacteriales
    assertEquals( determinedMap.get(Gammaproteobacteria).getConfidence(), 3.0f, 0.0001)//Gammaproteobacteria
    assertEquals( determinedMap.get(rootTree).getConfidence(), 4.0f, 0.0001)//Bacteria
        // end test addConfidence()
       
       
        // end of
        dstream = System.class.getResourceAsStream("/test/classifier/testQuerySeq.fasta");
        in =  new InputStreamReader( dstream );
        BufferedReader infile = new BufferedReader(in);
        // test the first sequence
        String sequence = "";
        infile.readLine();
        sequence = infile.readLine();
        sequence = sequence.toUpperCase();
        ClassifierSequence pSeq = new ClassifierSequence("name", "title", sequence);
        ClassificationResult result = aClassifier.classify(pSeq);
       
        Iterator it = result.getAssignments().iterator();
        RankAssignment classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , rootTree.getName());
        assertEquals(classResult.getConfidence(), 1.0, 0.1);
        classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , "Proteobacteria");
        it.next();
        classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , "Rhizobiales");
        it.next();
        classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , "Rhizobium");
       
        //displayResult(result);
        // end of test first sequence
       
        // test the second sequence
        infile.readLine();
        sequence = infile.readLine();
        sequence = sequence.toUpperCase();
        pSeq = new ClassifierSequence("name", "title", sequence);
        result = aClassifier.classify(pSeq);
       
       
        it = result.getAssignments().iterator();
        classResult = (RankAssignment) it.next();
        assertEquals(classResult.getBestClass().getName() , rootTree.getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.