Examples of RBagPlot


Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

  @Test
  public void testAttemptSingleDotBagPlot3()
  {
    final String X="axisX", Y="axisY";
    RBagPlot g=new RBagPlot(X,Y, new File("someName"));
    g.add(0.,1.);
    g.add(0.,1.);
    Assert.assertTrue(g.checkSingleDot());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testAttemptSingleDotBagPlot4()
  {
    final String X="axisX", Y="axisY";
    RBagPlot g=new RBagPlot(X,Y, new File("someName"));
    g.add(0.,1.);
    g.add(0.,2.);
    Assert.assertFalse(g.checkSingleDot());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testAttemptSingleDotBagPlot5()
  {
    final String X="axisX", Y="axisY";
    RBagPlot g=new RBagPlot(X,Y, new File("someName"));
    g.add(0.,1.);
    g.add(1.,1.);
    Assert.assertFalse(g.checkSingleDot());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testBoundaries1()
  {
    final String X="axisX", Y="axisY";
    RGraph<Double> g=new RBagPlot(X,Y, new File("someName"));
    g.setXboundaries(5.5, 34.);
    g.add(5.5,34.);g.add(5.5,34.);g.add(5.5,2.);g.add(7.5,2.);
    Assert.assertEquals(Collections.singletonList("bagplot(c(5.5,5.5,5.5,7.5),c(34.0,34.0,2.0,2.0),xlab=\""+X+"\",ylab=\""+Y+"\")"),g.getDrawingCommand());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testBoundaries2()
  {
    final String X="axisX", Y="axisY";
    RGraph<Double> g=new RBagPlot(X,Y, new File("someName"));
    g.setXboundaries(5.6, 34.);
    g.add(5.5,34.);g.add(5.5,34.);g.add(5.5,2.);g.add(7.5,2.);
    Assert.assertEquals(Collections.singletonList("bagplot(c(7.5),c(2.0),xlab=\""+X+"\",ylab=\""+Y+"\")"),g.getDrawingCommand());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testBoundaries3()
  {
    final String X="axisX", Y="axisY";
    RGraph<Double> g=new RBagPlot(X,Y, new File("someName"));
    g.setYboundaries(5.5, 34.);
    g.add(5.5,34.);g.add(5.5,34.);g.add(5.5,2.);g.add(7.5,2.);
    Assert.assertEquals(Collections.singletonList("bagplot(c(5.5,5.5),c(34.0,34.0),xlab=\""+X+"\",ylab=\""+Y+"\")"),g.getDrawingCommand());
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testBoundaries4()
  {
    final String X="axisX", Y="axisY";
    final RGraph<Double> g=new RBagPlot(X,Y, new File("someName"));
    g.setXboundaries(5.5, -34.);
    g.setYboundaries(5.5, -34.);
    g.add(5.5,34.);g.add(5.5,34.);g.add(5.5,2.);g.add(7.5,2.);
    checkForCorrectException(new whatToRun() { public @Override void run() {
      g.getDrawingCommand();
    }},IllegalArgumentException.class,"empty");
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

    // Inference from a few traces
    final int traceQuantityToUse = traceQuantity;
    SquareBagPlot gr_StructuralDiff = new SquareBagPlot("Structural score, EDSM,>=2","Structural Score, EDSM-Markov learner",new File(branch+"_"+(traceQuantityToUse/2)+"_trace_structuraldiff.pdf"),0,1,true);
    SquareBagPlot gr_BCR = new SquareBagPlot("BCR, EDSM,>=2","BCR, EDSM-Markov learner",new File(branch+"_"+(traceQuantityToUse/2)+"_trace_bcr.pdf"),0.5,1,true);
    RBagPlot gr_BCR_singletons = new RBagPlot("%% states identified by singletons","BCR Score, EDSM-Markov learner",new File(branch+"_"+(traceQuantityToUse/2)+"_trace_bcr_singletons.pdf"));
    RBagPlot gr_BCR_states = new RBagPlot("number of states in reference","BCR Score, EDSM-Markov learner",new File(branch+"_"+(traceQuantityToUse/2)+"_trace_bcr_numberofstates.pdf"));
    ScatterPlot gr_ImprovementPerState = new ScatterPlot("State number", "BCR, improvement",new File(branch+"_"+(traceQuantityToUse/2)+"_bcr_statenumber.pdf"));
    for(final boolean onlyPositives:new boolean[]{true})
      for(final double alphabetMultiplier:new double[]{alphabetMultiplierMax})
      {
            final int totalTaskNumber = traceQuantityToUse;
            try
            {
              int numberOfTasks = 0;
              for(int states=minStateNumber;states < minStateNumber+rangeOfStateNumbers;states+=stateNumberIncrement)
                for(int sample=0;sample<samplesPerFSM;++sample)
                {
                  LearnerRunner learnerRunner = new LearnerRunner(states,sample,totalTaskNumber+numberOfTasks,traceQuantityToUse, config, converter);
                  learnerRunner.setOnlyUsePositives(onlyPositives);
                  learnerRunner.setAlphabetMultiplier(alphabetMultiplier);
                  learnerRunner.setTraceLengthMultiplier(traceLengthMultiplierMax);learnerRunner.setChunkLen(chunkSize);
                  learnerRunner.setSelectionID(branch+"_states"+states+"_sample"+sample);
                  runner.submit(learnerRunner);
                  ++numberOfTasks;
                }
              ProgressIndicator progress = new ProgressIndicator(new Date()+" evaluating "+numberOfTasks+" tasks for learning whole graphs", numberOfTasks);
              for(int count=0;count < numberOfTasks;++count)
              {
                ThreadResult result = runner.take().get();// this will throw an exception if any of the tasks failed.
                for(SampleData sample:result.samples)
                  gr_StructuralDiff.add(sample.referenceLearner.differenceStructural.getValue(),sample.actualLearner.differenceStructural.getValue());
             
                for(SampleData sample:result.samples)
                {
                  gr_BCR.add(sample.referenceLearner.differenceBCR.getValue(),sample.actualLearner.differenceBCR.getValue());
                  gr_BCR_singletons.add((double)sample.fractionOfStatesIdentifiedBySingletons,sample.actualLearner.differenceBCR.getValue());
                  gr_BCR_states.add((double)sample.stateNumber,sample.actualLearner.differenceBCR.getValue());
                  if (sample.referenceLearner.differenceBCR.getValue() > 0)
                  gr_ImprovementPerState.add((double)sample.stateNumber,sample.actualLearner.differenceBCR.getValue()/sample.referenceLearner.differenceBCR.getValue());
                }
                progress.next();
              }
              gr_StructuralDiff.drawInteractive(gr);gr_BCR.drawInteractive(gr);gr_BCR_singletons.drawInteractive(gr);gr_BCR_states.drawInteractive(gr);gr_ImprovementPerState.drawInteractive(gr);
            }
            catch(Exception ex)
            {
              IllegalArgumentException e = new IllegalArgumentException("failed to compute, the problem is: "+ex);e.initCause(ex);
              if (executorService != null) { executorService.shutdownNow();executorService = null; }
              throw e;
            }
      }
      if (gr_StructuralDiff != null) gr_StructuralDiff.drawPdf(gr);
      if (gr_BCR != null) gr_BCR.drawPdf(gr);
      if (gr_BCR_singletons != null) gr_BCR_singletons.drawPdf(gr);
      if (gr_BCR_states != null) gr_BCR_states.drawPdf(gr);
      if (gr_ImprovementPerState != null) gr_ImprovementPerState.drawPdf(gr);

    final RBoxPlot<String> gr_BCRImprovementForDifferentAlphabetSize = new RBoxPlot<String>("alphabet multiplier","improvement, BCR",new File(branch+"BCR_vs_alphabet.pdf"));
    final RBoxPlot<String> gr_BCRForDifferentAlphabetSize = new RBoxPlot<String>("alphabet multiplier","BCR",new File(branch+"BCR_absolute_vs_alphabet.pdf"));
    final RBoxPlot<String> gr_StructuralImprovementForDifferentAlphabetSize = new RBoxPlot<String>("alphabet multiplier","improvement, structural",new File(branch+"structural_vs_alphabet.pdf"));
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

  }
 
  @Test
  public void testGenerateGraphFail1b()
  {
    final RGraph<Double> g=new RBagPlot("axisX", "axisY", new File("someName"));
    checkForCorrectException(new whatToRun() { public @Override void run() {
      g.getDrawingCommand();
    }},IllegalArgumentException.class,"empty");
  }
View Full Code Here

Examples of statechum.analysis.learning.DrawGraphs.RBagPlot

 
  @Test
  public void testGenerateGraph1b()
  {
    final String X="axisX", Y="axisY";
    RGraph<Double> g=new RBagPlot(X,Y, new File("someName"));
    g.add(4.5,34.);
    Assert.assertEquals("bagplot(c(4.5),c(34.0),xlab=\""+X+"\",ylab=\""+Y+"\")",g.getDrawingCommand());
  }
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.