Examples of createMarkovLearner()


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()

          }
        });
        assert sPlus.size() > 0;
        assert sMinus.size() > 0;
        final MarkovModel m= new MarkovModel(chunkLen,true,true);
        m.createMarkovLearner(sPlus, sMinus,false);
       
        pta.clearColours();

        if (!onlyUsePositives)
          assert pta.getStateNumber() > pta.getAcceptStateNumber() : "graph with only accept states but onlyUsePositives is not set";
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();

        if (!onlyUsePositives)
          assert pta.getStateNumber() > pta.getAcceptStateNumber() : "graph with only accept states but onlyUsePositives is not set";
View Full Code Here

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

  @Test
  public void testMarkovUpdate1_longest()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","b"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,true);

    final LearnerGraph graph = new LearnerGraph(config);graph.paths.augmentPTA(plusStrings, true, false);graph.paths.augmentPTA(minusStrings, false, false);
    MarkovModel mOther = new MarkovModel(2,true,true);
    new MarkovClassifier(mOther,graph).updateMarkov(true);
    Assert.assertEquals(m.predictionsMatrix,mOther.predictionsMatrix);
View Full Code Here

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

  @Test
  public void testMarkovUpdate1_prefixclosed()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"},new String[]{"c","b"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,false);

    final LearnerGraph graph = new LearnerGraph(config);graph.paths.augmentPTA(plusStrings, true, false);graph.paths.augmentPTA(minusStrings, false, false);
    MarkovModel mOther = new MarkovModel(2,true,true);
    new MarkovClassifier(mOther,graph).updateMarkov(false);
    Assert.assertEquals(m.predictionsMatrix,mOther.predictionsMatrix);
View Full Code Here

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

  @Test
  public void testMarkovUpdate2()
  {
    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[][] {},config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,true);

    final LearnerGraph graph = new LearnerGraph(config);graph.paths.augmentPTA(plusStrings, true, false);graph.paths.augmentPTA(minusStrings, false, false);
    MarkovModel mOther = new MarkovModel(2,true,true);new MarkovClassifier(mOther,graph).updateMarkov(true);
    Assert.assertEquals(m.predictionsMatrix,mOther.predictionsMatrix);
    Assert.assertEquals(m.occurrenceMatrix,mOther.occurrenceMatrix);
View Full Code Here

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

  @Test
  public void testMarkovUpdate3()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] {},config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,true);

    final LearnerGraph graph = new LearnerGraph(config);graph.paths.augmentPTA(plusStrings, true, false);graph.paths.augmentPTA(minusStrings, false, false);
    MarkovModel mOther = new MarkovModel(2,true,true);new MarkovClassifier(mOther,graph).updateMarkov(true);
    Assert.assertEquals(m.predictionsMatrix,mOther.predictionsMatrix);
    Assert.assertEquals(m.occurrenceMatrix,mOther.occurrenceMatrix);
View Full Code Here

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

  /** Tests that creating a model from PTA and from initial traces give the same result. */
  public void testMarkovUpdate4()
  {
    MarkovModel m = new MarkovModel(2,true,true);
    Set<List<Label>> plusStrings = buildSet(new String[][] { new String[]{"a","b"} },config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","u"} },config,converter);
    m.createMarkovLearner(plusStrings, minusStrings,true);

    final LearnerGraph graph = new LearnerGraph(config);graph.paths.augmentPTA(plusStrings, true, false);graph.paths.augmentPTA(minusStrings, false, false);
    MarkovModel mOther = new MarkovModel(2,true,true);new MarkovClassifier(mOther,graph).updateMarkov(true);
    Assert.assertEquals(m.predictionsMatrix,mOther.predictionsMatrix);
    Assert.assertEquals(m.occurrenceMatrix,mOther.occurrenceMatrix);
View Full Code Here

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

    Assert.assertEquals(MarkovOutcome.positive,m.predictionsMatrix.get(new Trace(Arrays.asList(new Label[]{lblB}),true)));
    Assert.assertEquals(MarkovOutcome.negative,m.predictionsMatrix.get(new Trace(Arrays.asList(new Label[]{lblC}),true)));
   
    Set<List<Label>> plusStrings = buildSet(new String[][] {},config,converter), minusStrings = buildSet(new String[][] { new String[]{"a","a","a"},new String[]{"a","b","a"},new String[]{"a","c"} },config,converter);
    MarkovModel another = new MarkovModel(2,true,true);
    another.createMarkovLearner(plusStrings, minusStrings, false);

    Assert.assertEquals(7,another.predictionsMatrix.size());
    Assert.assertEquals(MarkovOutcome.failure,another.predictionsMatrix.get(new Trace(Arrays.asList(new Label[]{lblA,lblA}),true)));
    Assert.assertEquals(MarkovOutcome.positive,another.predictionsMatrix.get(new Trace(Arrays.asList(new Label[]{lblA,lblB}),true)));
    Assert.assertEquals(MarkovOutcome.negative,another.predictionsMatrix.get(new Trace(Arrays.asList(new Label[]{lblA,lblC}),true)));
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);
    Map<Trace, MarkovOutcome> matrix = m.createMarkovLearner(plusStrings, minusStrings,false);
    Assert.assertEquals(11,matrix.size());
    Assert.assertSame(MarkovOutcome.negative, matrix.get(new Trace(Arrays.asList(new Label[]{lblA,lblU}),true)));

    Assert.assertSame(MarkovOutcome.positive, matrix.get(new Trace(Arrays.asList(new Label[]{lblD,lblC}),true)));
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.