Package statechum.analysis.learning.PrecisionRecall

Examples of statechum.analysis.learning.PrecisionRecall.PosNegPrecisionRecall


   
    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());
    }
   
    linearDiff(cvsGraph, markov);
    linearDiff(cvsGraph, new LearnerGraphND(edsm,config));
  }
View Full Code Here


   
    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());
    }
   
    linearDiff(cvsGraph, markov);
    linearDiff(cvsGraph, new LearnerGraphND(edsm,config));
  }
View Full Code Here

      sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);

      LearnerGraph learnt = learn(l,sMinus);
      PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learnt);
      PTASequenceEngine engine = new PTA_FSMStructure(graph);
      PosNegPrecisionRecall ptaPR = precRec.crossWith(sMinus);
      SequenceSet ptaTestSet = engine.new SequenceSet();ptaTestSet.setIdentity();
      ptaTestSet = ptaTestSet.cross(graph.wmethod.getFullTestSet(1));
      PosNegPrecisionRecall prNeg = precRec.crossWith(engine);
     
      assert questionNumber.get() == l.getQuestionCounter();
     
      // Column 0 is the name of the learner.
      // Columns 3 and 4
      result = result+prNeg.getPrecision()+FS+prNeg.getRecall();
     
      result = result + FS + questionNumber+ FS + // 5
        // Columns 6 and 7
        ptaPR.getPrecision()  + FS + ptaPR.getRecall() + FS +
        "size:"+size+FS+ // 8
View Full Code Here

      sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);

      LearnerGraph learnt = learn(l,sMinus);
      PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learnt);
      PTASequenceEngine engine = new PTA_FSMStructure(graph,null);
      precRec.crossWith(sMinus);PosNegPrecisionRecall ptaPR = precRec.getPosNegPrecisionRecallNum();
      SequenceSet ptaTestSet = engine.new SequenceSet();ptaTestSet.setIdentity();
      ptaTestSet = ptaTestSet.cross(graph.wmethod.getFullTestSet(1));
      precRec.crossWith(engine);PosNegPrecisionRecall prNeg = precRec.getPosNegPrecisionRecallNum();
     
      assert questionNumber.get() == l.getQuestionCounter();
     
      // Column 0 is the name of the learner.
      // Columns 3 and 4
      result = result+prNeg.getPrecision()+FS+prNeg.getRecall();
     
      result = result + FS + questionNumber+ FS + // 5
        // Columns 6 and 7
        ptaPR.getPrecision()  + FS + ptaPR.getRecall() + FS +
        "size:"+size+FS+ // 8
View Full Code Here

  public static void compare(DirectedSparseGraph spec, DirectedSparseGraph imp){
    LearnerGraph specfsm =new LearnerGraph(spec, Configuration.getDefaultConfiguration());
    Visualiser v = new Visualiser(0);
    v.construct(specfsm.pathroutines.getGraph(),null);   
    LearnerGraph wm = new LearnerGraph(imp,Configuration.getDefaultConfiguration());
    PosNegPrecisionRecall pr = compare(specfsm, wm);
    System.out.println(pr.getPosprecision()+", "+pr.getPosrecall()+", "+pr.getNegprecision()+", "+pr.getNegrecall());
  }
View Full Code Here

    specfsm = target;
  }

 
  public void trackResults(LearnerGraph graph) {
    PosNegPrecisionRecall pr = CompareGraphs.compare(tests, specfsm, graph);
    double accuracy = CompareGraphs.computeAccuracy(graph, specfsm, samples);
    ResultsContainer result = new ResultsContainer(accuracy, pr);
    currentResults.add(result);
   
  }
View Full Code Here

   
    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());
    }
   
    linearDiff(cvsGraph, markov);
    linearDiff(cvsGraph, new LearnerGraphND(edsm,config));
  }
View Full Code Here

      if (graph.paths.tracePath(neg, true) == AbstractOracle.USER_ACCEPTED)
        positiveRet.add(neg);
      else
        negativeRet.add(neg);

    return new PosNegPrecisionRecall(positiveRet, positiveRel, negativeRet, negativeRel);
  }
View Full Code Here

    for(int i=0;i < 12;++i)
      initSet = initSet.crossWithSet(alphabet);
   
    // Second, we run them on both graphs
   
    PosNegPrecisionRecall bruteForcePR = computePrecisionRecall(graph, sequences);
    PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(graph);
    precRec.crossWith(sequences);
    PosNegPrecisionRecall actualPR = precRec.getPosNegPrecisionRecallNum();
   
    // Third, we compare precision/recall computed in two different ways
   
    assertEquals("pos precision",bruteForcePR.getPosprecision(), actualPR.getPosprecision(),Configuration.fpAccuracy);
    assertEquals("pos recall",bruteForcePR.getPosrecall(), actualPR.getPosrecall(),Configuration.fpAccuracy);
    assertEquals("neg precision",bruteForcePR.getNegprecision(), actualPR.getNegprecision(),Configuration.fpAccuracy);
    assertEquals("neg recall",bruteForcePR.getNegrecall(), actualPR.getNegrecall(),Configuration.fpAccuracy);
  }
View Full Code Here

      sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);

      LearnerGraph learnt = learn(l,sMinus);
      PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learnt);
      PTASequenceEngine engine = new PTA_FSMStructure(graph,null);
      precRec.crossWith(sMinus);PosNegPrecisionRecall ptaPR = precRec.getPosNegPrecisionRecallNum();
      SequenceSet ptaTestSet = engine.new SequenceSet();ptaTestSet.setIdentity();
      ptaTestSet = ptaTestSet.cross(graph.wmethod.getFullTestSet(1));
      precRec.crossWith(engine);PosNegPrecisionRecall prNeg = precRec.getPosNegPrecisionRecallNum();
     
      assert questionNumber.get() == l.getQuestionCounter();
     
      // Column 0 is the name of the learner.
      // Columns 3 and 4
      result = result+prNeg.getPrecision()+FS+prNeg.getRecall();
     
      result = result + FS + questionNumber+ FS + // 5
        // Columns 6 and 7
        ptaPR.getPrecision()  + FS + ptaPR.getRecall() + FS +
        "size:"+size+FS+ // 8
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.PrecisionRecall.PosNegPrecisionRecall

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.