Examples of createMarkovLearner()


Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCheckFanoutInconsistency1e()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","u"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"}},config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-b-#F / T-b->T-u->T-d->T","testCheckFanoutInconsistency1e",config, converter);
   
    Assert.assertEquals(1,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("B"),new MarkovClassifier.DifferentPredictionsInconsistency()));
  }
 
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCheckFanoutInconsistency1f()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","u"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-d-#F / T-b->T-u->T-d->T","testCheckFanoutInconsistency1f",config, converter);
   
    Assert.assertEquals(1,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("B"),new MarkovClassifier.DifferentPredictionsInconsistency()));
    Assert.assertEquals(4.,MarkovClassifier.computeInconsistency(graph,  m, new MarkovClassifier.DifferentPredictionsInconsistency(),false),Configuration.fpAccuracy);// inconsistencies detected are mostly due to state T
  }
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCheckFanoutInconsistency2()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","u"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B-b->C / B-u->F / T-b->T-u->T","testCheckFanoutInconsistency2",config, converter);
   
    Assert.assertEquals(2,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("B"),new MarkovClassifier.DifferentPredictionsInconsistency()));
  }
 
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCheckFanoutInconsistency3()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","b"},new String[]{"c","u"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B-u->C / T-b->T-u->T","testCheckFanoutInconsistency3",config, converter);
   
    Assert.assertEquals(1,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("B"),new MarkovClassifier.DifferentPredictionsInconsistency()));
  }
 
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCheckFanoutInconsistency4()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","b"},new String[]{"c","u"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->D-b->C / A-c->B-b->C / B-u->E / T-b->T-u->T","testCheckFanoutInconsistency4",config, converter);
   
   
    Assert.assertEquals(0,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("B"),new MarkovClassifier.DifferentPredictionsInconsistency()));// everything as expected.
    Assert.assertEquals(0,new MarkovClassifier(m,graph).checkFanoutInconsistency(graph.findVertex("D"),new MarkovClassifier.DifferentPredictionsInconsistency()));// missing reject-transition with label u is ignored because we are only considering actual outgoing transitions
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

          }
        });
        assert sPlus.size() > 0;
        assert sMinus.size() > 0;
        final MarkovModel m= new MarkovModel(chunkLen,true,true);
        m.createMarkovLearner(sPlus, sMinus,false);
       
        pta.clearColours();
        synchronized (AbstractLearnerGraph.syncObj) {
          //PaperUAS.computePTASize(selectionID+" attempt: "+attempt+" with unique: ", pta, referenceGraph);
        }
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCreateMarkovMatrix1()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b","c"}, new String[]{"a","b"}, new String[]{"a","d","c"}},config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","b","c","d"}, new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    Map<List<Label>, MarkovOutcome> matrix = m.computePredictionMatrix();
    Assert.assertEquals(11,matrix.size());
   
    Assert.assertSame(MarkovOutcome.negative, matrix.get(Arrays.asList(new Label[]{lblA,lblU})));
    Assert.assertSame(MarkovOutcome.positive, matrix.get(Arrays.asList(new Label[]{lblD,lblC})));
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCreateMarkovMatrix2()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter), minusStrings = new HashSet<List<Label>>();
    m.createMarkovLearner(plusStrings, minusStrings,false);
    Map<List<Label>, MarkovOutcome> matrix = m.computePredictionMatrix();
    Assert.assertEquals(3,matrix.size());
   
    Assert.assertSame(MarkovOutcome.positive, matrix.get(Arrays.asList(new Label[]{lblA,lblU})));
    Assert.assertSame(MarkovOutcome.positive, matrix.get(Arrays.asList(new Label[]{lblA})));
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCreateMarkovMatrix3a()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = new HashSet<List<Label>>(), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    Map<List<Label>, MarkovOutcome> matrix = m.computePredictionMatrix();
    Assert.assertEquals(3,matrix.size());

    Assert.assertSame(MarkovOutcome.negative, matrix.get(Arrays.asList(new Label[]{lblA,lblU})));
    Assert.assertSame(MarkovOutcome.positive, matrix.get(Arrays.asList(new Label[]{lblA})));
View Full Code Here

Examples of statechum.analysis.learning.MarkovModel.createMarkovLearner()

  @Test
  public void testCreateMarkovMatrix3b()
  {
    MarkovModel m = new MarkovModel(3,true,true);
    Set<List<Label>> plusStrings = new HashSet<List<Label>>(), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);
    Map<List<Label>, MarkovOutcome> matrix = m.computePredictionMatrix();
    Assert.assertEquals(3,matrix.size());

    Assert.assertSame(MarkovOutcome.negative, matrix.get(Arrays.asList(new Label[]{lblA,lblU})));
    Assert.assertSame(MarkovOutcome.positive, matrix.get(Arrays.asList(new Label[]{lblA})));
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.