Examples of computeInverseGraph()


Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    Assert.assertEquals(4,m.getMarkov(true).size());
    Assert.assertTrue(m.getMarkov(false).isEmpty());
    final Map<Trace, MarkovOutcome> markovMatrix = m.getMarkov(true);
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Map<Label,MarkovOutcome> outgoing_labels_probabilities=m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{}),m.getChunkLen(),null);
    Assert.assertEquals(2,outgoing_labels_probabilities.size());
    Assert.assertEquals(MarkovOutcome.negative,outgoing_labels_probabilities.get(lblU));
    Assert.assertEquals(MarkovOutcome.positive,outgoing_labels_probabilities.get(lblB));
  }
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    Assert.assertEquals(4,m.getMarkov(true).size());
    Assert.assertTrue(m.getMarkov(false).isEmpty());
    final Map<Trace, MarkovOutcome> markovMatrix = m.getMarkov(true);
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Map<Label,MarkovOutcome> outgoing_labels_probabilities=m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{}),m.getChunkLen(),null);
    Assert.assertEquals(2,outgoing_labels_probabilities.size());
    Assert.assertEquals(MarkovOutcome.negative,outgoing_labels_probabilities.get(lblU));
    Assert.assertEquals(MarkovOutcome.positive,outgoing_labels_probabilities.get(lblB));
  }
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    Assert.assertTrue(m.getMarkov(false).isEmpty());
    final Map<Trace, MarkovOutcome> markovMatrix = m.getMarkov(true);

   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-d->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Map<Label,MarkovOutcome> outgoing_labels_probabilities=m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{lblA}),m.getChunkLen(),null);
    Assert.assertEquals(2,outgoing_labels_probabilities.size());
    Assert.assertEquals(MarkovOutcome.negative,outgoing_labels_probabilities.get(lblU));
    Assert.assertEquals(MarkovOutcome.positive,outgoing_labels_probabilities.get(lblB));
  }
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-d->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{lblA,lblB}),m.getChunkLen(),null);
      }
    }, IllegalArgumentException.class, "supplied path");
  }

  @Test
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    Assert.assertTrue(m.getMarkov(false).isEmpty());
    final Map<Trace, MarkovOutcome> markovMatrix = m.getMarkov(true);

   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-d->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Map<Label,MarkovOutcome> outgoing_labels_probabilities=m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{lblA}),m.getChunkLen(),null);
    Assert.assertEquals(2,outgoing_labels_probabilities.size());
    Assert.assertEquals(MarkovOutcome.negative,outgoing_labels_probabilities.get(lblU));
    Assert.assertEquals(MarkovOutcome.positive,outgoing_labels_probabilities.get(lblB));
  }
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.computeInverseGraph()

    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-d->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        m.predictTransitionsFromState(markovMatrix,m.computeInverseGraph(graph2, true),true,graph2.findVertex("B"),graph2.getCache().getAlphabet(),Arrays.asList(new Label[]{lblA,lblB}),m.getChunkLen(),null);
      }
    }, IllegalArgumentException.class, "supplied path");
  }

  @Test
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.