Package statechum.model.testset

Examples of statechum.model.testset.PTA_FSMStructure


  /** Test sequence (which exists) which is rejected part-way, shorter than a test sequence but is all ignored. */
  @Test
  public final void testPrecisionRecall_ign3() 
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c","c","c"}, // +
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);

    engine = new PTA_FSMStructure(mach,null);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c"}, // +, FN
      },mainConfiguration,converter));
    precComputer.crossWith(engine);
View Full Code Here


  /** Test sequence (which exists) which is rejected part-way, but first part of it is ignored. */
  @Test
  public final void testPrecisionRecall_ign4() 
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c"}, // +
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
   
    engine = new PTA_FSMStructure(mach,null);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c"}, // +, FN
      },mainConfiguration,converter));
    precComputer.crossWith(engine);
View Full Code Here

  /** Test sequence (which exists) which is accepted. */
  @Test
  public final void testPrecisionRecall_ign5() 
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, // +
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
   
    engine = new PTA_FSMStructure(mach,null);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","b"}, // +
      },mainConfiguration,converter));
    precComputer.crossWith(engine);
View Full Code Here

  /** Test sequence (which exists) which is accepted. */
  @Test
  public final void testPrecisionRecall_ign6() 
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","b"}, // +
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
   
    engine = new PTA_FSMStructure(mach,null);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, // +
      },mainConfiguration,converter));
    precComputer.crossWith(engine);
View Full Code Here

  /** Test sequence (which exists), all of it is ignored. */
  @Test
  public final void testPrecisionRecall_ign7() 
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","b"}, // +
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
   
    engine = new PTA_FSMStructure(mach,null);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","b"}, // +
      },mainConfiguration,converter));
    precComputer.crossWith(engine);
View Full Code Here

 
  @Test
  public final void testPrecisionRecall_ign8() // a complex structure, most of which gets ignored.
  {
    LearnerGraph mach = buildLearnerGraph("AM-a->BM-a->AM\nBM-b->CM-a->DM","testPrecisionRecall_ign2",mainConfiguration,converter);
    PTASequenceEngine engine = new PTA_FSMStructure(mach,null);
    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"}
      },mainConfiguration,converter));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
View Full Code Here

      QuestionAndRestartCounter l = new QuestionAndRestartCounter(learner);
      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();
     
View Full Code Here

    Set<Label> alphabet =  coregraph.learnerCache.getAlphabet();
    List<List<Label>> stateCover = coregraph.pathroutines.computeStateCover(initialState);
    characterisationSet = computeWSet_reducedmemory(coregraph);if (characterisationSet.isEmpty()) characterisationSet.add(Arrays.asList(new Label[]{}));
    transitionCover = crossWithSet(stateCover,alphabet);transitionCover.addAll(stateCover);

    PTASequenceEngine engine = new PTA_FSMStructure(coregraph,initialState);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(stateCover);
   
    partialPTA.cross(characterisationSet);
    for(int i=0;i<=numberOfExtraStates;i++)
View Full Code Here

      QuestionAndRestartCounter l = new QuestionAndRestartCounter(learner);
      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();
     
View Full Code Here

    final RandomPathGenerator generator = new RandomPathGenerator(cvsGraph,new Random(0),5,null);
    final int posOrNegPerChunk = 50;
    generator.generateRandomPosNeg(posOrNegPerChunk*2,1);
    Collection<List<Label>> sequences = cvsGraph.wmethod.getFullTestSet(1);//generator.getAllSequences(0).getData(PTASequenceEngine.truePred);

    PTASequenceEngine walkEngine = new PTA_FSMStructure(cvsGraph,null);
    SequenceSet ptaWalk = walkEngine.new SequenceSet();ptaWalk.setIdentity();
    ptaWalk = ptaWalk.cross(sequences);
   
   
   
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTA_FSMStructure

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.