Package statechum.model.testset

Examples of statechum.model.testset.PTA_computePrecisionRecall


    SequenceSet ptaWalk = walkEngine.new SequenceSet();ptaWalk.setIdentity();
    ptaWalk = ptaWalk.cross(sequences);
   
   
   
    PTA_computePrecisionRecall precRec = null;
   
    {
      precRec = new PTA_computePrecisionRecall(markovD);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "Markov";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }

    {
      precRec = new PTA_computePrecisionRecall(edsm);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "EDSM";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }
View Full Code Here


    SequenceSet ptaWalk = walkEngine.new SequenceSet();ptaWalk.setIdentity();
    ptaWalk = ptaWalk.cross(sequences);
   
   
   
    PTA_computePrecisionRecall precRec = null;
   
    {
      precRec = new PTA_computePrecisionRecall(markovD);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "Markov";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }

    {
      precRec = new PTA_computePrecisionRecall(edsm);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "EDSM";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }
View Full Code Here

    PosNegPrecisionRecall pr = compare(specfsm, wm);
    System.out.println(pr.getPosprecision()+", "+pr.getPosrecall()+", "+pr.getNegprecision()+", "+pr.getNegrecall());
  }
 
  public static PosNegPrecisionRecall compare(LearnerGraph specfsm, LearnerGraph imp){
    PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(imp);
    PTASequenceEngine engine = new PTA_FSMStructure(specfsm,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(specfsm.wmethod.getFullTestSet(1));
    precRec.crossWith(engine);return precRec.getPosNegPrecisionRecallNum();
  }
View Full Code Here

    partialPTA = partialPTA.cross(specfsm.wmethod.getFullTestSet(1));
    precRec.crossWith(engine);return precRec.getPosNegPrecisionRecallNum();
  }
 
  public static PosNegPrecisionRecall compare(Collection<List<Label>> tests, LearnerGraph specfsm, LearnerGraph imp){
    PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(imp);
    PTASequenceEngine engine = new PTA_FSMStructure(specfsm,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(tests);
    precRec.crossWith(engine);return precRec.getPosNegPrecisionRecallNum();
  }
View Full Code Here

            (testSequencesB==null?"NONE":testSequencesB.getData(PTASequenceEngine.truePred)));
        */
       
        double bcrA = 0., bcrB= 0.;
        {
          PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(stateToCorrespondingGraph.get(stateA).graph);
          if (testSequencesB != null) precRec.crossWith(testSequencesB);
          bcrA=precRec.getBCR();
        }
        {
          PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(stateToCorrespondingGraph.get(stateB).graph);
          if (testSequencesA != null) precRec.crossWith(testSequencesA);
          bcrB=precRec.getBCR();
        }
        double multiplier = 100.;
        if (config.getGdScoreComputation() == GDScoreComputationEnum.GD_RH)
          rightHandSide = multiplier*(bcrA+bcrB)*totalOutgoing/2.;
        else
 
View Full Code Here

    SequenceSet ptaWalk = walkEngine.new SequenceSet();ptaWalk.setIdentity();
    ptaWalk = ptaWalk.cross(sequences);
   
   
   
    PTA_computePrecisionRecall precRec = null;
   
    {
      precRec = new PTA_computePrecisionRecall(markovD);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "Markov";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }

    {
      precRec = new PTA_computePrecisionRecall(edsm);
      precRec.crossWith(walkEngine);PosNegPrecisionRecall result = precRec.getPosNegPrecisionRecallNum();
      final String name = "EDSM";
      System.out.println(name+": +precision "+result.getPosprecision()+" +recall: "+result.getPosrecall());
      System.out.println(name+": -precision "+result.getNegprecision()+" -recall: "+result.getNegrecall());
      System.out.println(name+": =precision "+result.getPrecision()+" =recall: "+result.getRecall());
    }
View Full Code Here

    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, // +
        new String[]{"b"}      // -
      },config));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals("true negatives",1, precComputer.resultTN);assertEquals("true positives",1, precComputer.resultTP);
    assertEquals("false negatives",0, precComputer.resultFN);assertEquals("false positives",0, precComputer.resultFP);
    assertEquals("positives relevant",1, precComputer.pos_Rel);assertEquals("negatives relevant",1, precComputer.neg_Rel);
    assertEquals("positives retrieved",1, precComputer.pos_Ret);assertEquals("negatives retrieved",1, precComputer.neg_Ret);
  }
View Full Code Here

    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"},// +
        new String[]{"b"},      // -
        new String[]{"a", "b"// -, FP
      },config));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals("true negatives",1, precComputer.resultTN);assertEquals("true positives",1, precComputer.resultTP);
    assertEquals("false negatives",0, precComputer.resultFN);assertEquals("false positives",1, precComputer.resultFP);
    assertEquals("positives relevant",1, precComputer.pos_Rel);assertEquals("negatives relevant",2, precComputer.neg_Rel);
    assertEquals("positives retrieved",2, precComputer.pos_Ret);assertEquals("negatives retrieved",1, precComputer.neg_Ret);
  }
View Full Code Here

        new String[] {"a","a","a"}, // +
        new String[]{"b"}, // -
        new String[]{"a", "b"} // -, FP
      },config));
    fsm = buildLearnerGraph("Q-a->Q / A-a->B-a->A-b-#C\nB-b->D-c->E\nD-a-#F", "testPrecisionRecall2b",config);
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm,fsm.findVertex(VertexID.parseID("A")));
    precComputer.crossWith(engine);
    assertEquals("true negatives",1, precComputer.resultTN);assertEquals("true positives",1, precComputer.resultTP);
    assertEquals("false negatives",0, precComputer.resultFN);assertEquals("false positives",1, precComputer.resultFP);
    assertEquals("positives relevant",1, precComputer.pos_Rel);assertEquals("negatives relevant",2, precComputer.neg_Rel);
    assertEquals("positives retrieved",2, precComputer.pos_Ret);assertEquals("negatives retrieved",1, precComputer.neg_Ret);
  }
View Full Code Here

    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","a","b"}, // -
        new String[]{"b"}, // -
        new String[]{"a", "b"} //, FP
      },config));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals("true negatives",2, precComputer.resultTN);assertEquals("true positives",0, precComputer.resultTP);
    assertEquals("false negatives",0, precComputer.resultFN);assertEquals("false positives",1, precComputer.resultFP);
    assertEquals("positives relevant",0, precComputer.pos_Rel);assertEquals("negatives relevant",3, precComputer.neg_Rel);
    assertEquals("positives retrieved",1, precComputer.pos_Ret);assertEquals("negatives retrieved",2, precComputer.neg_Ret);
  }
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTA_computePrecisionRecall

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.