Package statechum.model.testset.PTASequenceEngine

Examples of statechum.model.testset.PTASequenceEngine.SequenceSet


  }
 
  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


  }
 
  public static PosNegPrecisionRecall compare(Collection<List<String>> 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

  {
    PTASequenceEngine engine = null;
    if (!useNegatives)
    {
      PTASequenceEngine positives = new PTASequenceEngine();positives.init(new Automaton());
      SequenceSet initSeq = positives.new SequenceSet();initSeq.setIdentity();
      initSeq.cross(engineArg.getData());
      engine = positives;
    }
    else
      engine = engineArg;
   
View Full Code Here

  }
 
  @Test
  public final void testPrecisionRecall0()
  {
    SequenceSet seq = en.new SequenceSet();
    seq.crossWithSet(Arrays.asList(new String[] {"a"})); // appending anything to an empty sequence produces an empty sequence.
    TestPTASequenceEngine.vertifyPTA(en, 1, new String[][] {
        new String[] {}
    });
  }
View Full Code Here

  @Test
  public final void testPrecisionRecall1()
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("A-a->A-b-#B","testPrecisionRecall1"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, new String[]{"b"}
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(3, precComputer.pos_relret);assertEquals(1, precComputer.neg_relret);
View Full Code Here

  @Test
  public final void testPrecisionRecall2()
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("A-a->A-b-#B","testPrecisionRecall2"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, new String[]{"b"}, new String[]{"a", "b"}
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(3, precComputer.pos_relret);assertEquals(1, precComputer.neg_relret);
View Full Code Here

  @Test
  public final void testPrecisionRecall3()
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("A-a->A-b-#B","testPrecisionRecall3"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","a","b"}, new String[]{"b"}, new String[]{"a", "b"}
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(4, precComputer.pos_relret);assertEquals(2, precComputer.neg_relret);
View Full Code Here

  @Test
  public final void testPrecisionRecall4()
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->BM-a->AM\nBM-b->CM-a->DM","testPrecisionRecall4"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","a","b"}, new String[]{"b"}, new String[]{"a", "b", "c"}, new String[]{"a", "b", "a"}
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(5, precComputer.pos_relret);assertEquals(2, precComputer.neg_relret);
View Full Code Here

  @Test
  public final void testPrecisionRecall5() // long test sequence (which exists) which is rejected part-way
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall5"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c"},
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(2, precComputer.pos_relret);assertEquals(0, precComputer.neg_relret);
View Full Code Here

  @Test
  public final void testPrecisionRecall6() // long test sequence (which does not exist) which is rejected part-way
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall6"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c","d"},
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    assertEquals(2, precComputer.pos_relret);assertEquals(1, precComputer.neg_relret);
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTASequenceEngine.SequenceSet

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.