Package statechum.analysis.learning.experiments.PairSelection.WekaDataCollector

Examples of statechum.analysis.learning.experiments.PairSelection.WekaDataCollector.PairRank


  @Test
  public void TestCreateInstances6()
  {
    final WekaDataCollector classifier = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(classifier.new PairRank("conventional score")
    {// 1
      @Override
      public long getValue(@SuppressWarnings("unused") PairScore pair) {
        throw new UnsupportedOperationException("in this test, this method should not be called");
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(classifier.new PairRank("another score")
    {// 2
      @Override
      public long getValue(@SuppressWarnings("unused") PairScore pair) {
        throw new UnsupportedOperationException("in this test, this method should not be called");
      }
View Full Code Here


  public void testComputeAverageAndSD0()
  {
    WekaDataCollector classifier = new WekaDataCollector();
    PairScore pairA = new PairScore(tentativeGraph.findVertex(VertexID.parseID("A1")),tentativeGraph.findVertex(VertexID.parseID("B1")),1,0);
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(classifier.new PairRank("conventional score")
    {
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }
View Full Code Here

    PairScore pairA = new PairScore(tentativeGraph.findVertex(VertexID.parseID("A1")),tentativeGraph.findVertex(VertexID.parseID("B1")),1,0),
        pairB = new PairScore(tentativeGraph.findVertex(VertexID.parseID("A2")),tentativeGraph.findVertex(VertexID.parseID("B1")),1,0),
        pairC = new PairScore(tentativeGraph.findVertex(VertexID.parseID("C1")),tentativeGraph.findVertex(VertexID.parseID("C2")),2,0) // the score of 2 ensures it will be at the end of the keySet
        ;
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(classifier.new PairRank("conventional score")
    {
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }
View Full Code Here

    PairScore pairA = new PairScore(tentativeGraph.findVertex(VertexID.parseID("A1")),tentativeGraph.findVertex(VertexID.parseID("B1")),1,0),
        pairB = new PairScore(tentativeGraph.findVertex(VertexID.parseID("A2")),tentativeGraph.findVertex(VertexID.parseID("B1")),1,0),
        pairC = new PairScore(tentativeGraph.findVertex(VertexID.parseID("C1")),tentativeGraph.findVertex(VertexID.parseID("C2")),2,0) // the score of 2 ensures it will be at the end of the keySet
        ;
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(classifier.new PairRank("conventional score")
    {
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }
View Full Code Here

  @Before
  public void beforeTest()
  {
    testClassifier = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(testClassifier.new PairRank("statechum score")
    {// 1
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(testClassifier.new PairRank("statechum compatibility score")
    {// 2
      @Override
      public long getValue(PairScore pair) {
        return pair.getAnotherScore();
      }
View Full Code Here

      pairC=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),0,1),
      pairD=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),1,0);

    WekaDataCollector dataCollector = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(dataCollector.new PairRank("statechum score")
    {// 1
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(testClassifier.new PairRank("statechum compatibility score")
    {// 2
      @Override
      public long getValue(PairScore pair) {
        return pair.getAnotherScore();
      }
View Full Code Here

      pairC=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),0,0),
      pairD=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),1,0);

    WekaDataCollector dataCollector = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(dataCollector.new PairRank("statechum score")
    {// 1
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(testClassifier.new PairRank("statechum compatibility score")
    {// 2
      @Override
      public long getValue(PairScore pair) {
        return pair.getAnotherScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(testClassifier.new PairRank("1 for B or C, 0 otherwise")
    {// 3
      @Override
      public long getValue(PairScore pair) {
        return (pair == pairB || pair == pairC)?1:0;
      }
View Full Code Here

      pairC=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),0,1),
      pairD=new PairScore(tentativeGraph.findVertex("A1"), tentativeGraph.findVertex("B2"),1,0);

    final WekaDataCollector dataCollector = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(dataCollector.new PairRank("statechum score")
    {// 1
      @Override
      public long getValue(PairScore pair) {
        return pair.getScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
    assessors.add(testClassifier.new PairRank("statechum compatibility score")
    {// 2
      @Override
      public long getValue(PairScore pair) {
        return pair.getAnotherScore();
      }
View Full Code Here

  public static WekaDataCollector createDataCollector(final int ifDepth)
  {
    WekaDataCollector classifier = new WekaDataCollector();
    List<PairRank> assessors = new ArrayList<PairRank>(20);
     
    assessors.add(classifier.new PairRank("conventional score")
    {// 1
      @Override
      public long getValue(PairScore p) {
        return measurementsForCurrentStack(p).compatibilityScore;
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });

    assessors.add(classifier.new PairRank("statechum score")
    {// 2
      @Override
      public long getValue(PairScore p) {
        return p.getScore();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("size of tree rooted at Blue")
    {// 3
      @Override
      public long getValue(PairScore p) {
        return treeRootedAt(p.getQ());
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("Number of alternatives with same red")
    {// 4
      @Override
      public long getValue(PairScore p) {
        return  measurementsForCurrentStack(p).nrOfAlternatives;
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("Depth of Blue")
    {// 5
      @Override
      public long getValue(PairScore p) {
        return  p.getQ().getDepth();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("Depth of Red")
    {// 6
      @Override
      public long getValue(PairScore p) {
        return  p.getR().getDepth();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("Statechum score is above zero")
    {// 7
      @Override
      public long getValue(PairScore p) {
        return  p.getScore() > 0?1:0;
      }

      @Override
      public boolean isAbsolute() {
        return true;
      }
    });
   
    assessors.add(classifier.new PairRank("state identifiers Red")
    {// 8
      @Override
      public long getValue(PairScore p) {
        return p.getR().getIntegerID();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("state identifiers Blue")
    {// 9
      @Override
      public long getValue(PairScore p) {
        return p.getQ().getIntegerID();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("proximity of the red and blue by depth")
    {// 10
      @Override
      public long getValue(PairScore p) {
        return p.getQ().getDepth()-p.getR().getDepth();
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("difference between conventional scores divided by 3")
    {// 11
      @Override
      public long getValue(PairScore p) {
        return  measurementsForCurrentStack(p).compatibilityScore/3;
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("whether red and blue are adjacent")
    {// 12
      @Override
      public long getValue(PairScore p) {
        return measurementsForCurrentStack(p).adjacent? 1:0;
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("number of new outgoing transitions from blue")
    {// 13
      @Override
      public long getValue(PairScore p) {
        Map<Label,CmpVertex> redTransitions = tentativeGraph().transitionMatrix.get(p.getR());
        int counter = 0;
        for(Label lbl:tentativeGraph().transitionMatrix.get(p.getQ()).keySet())
          if (!redTransitions.containsKey(lbl))
            counter++;
       
        return counter;
      }

      @Override
      public boolean isAbsolute() {
        return false;
      }
    });
   
    assessors.add(classifier.new PairRank("number of new outgoing transitions from red")
    {// 14
      @Override
      public long getValue(PairScore p) {
        Map<Label,CmpVertex> redTransitions = tentativeGraph().transitionMatrix.get(p.getQ());
        int counter = 0;
View Full Code Here

  @Test
  public void testConstructTooBig1()
  {
    final WekaDataCollector classifier = new WekaDataCollector();
    final List<PairRank> assessors = new ArrayList<PairRank>(20);
    assessors.add(classifier.new PairRank("statechum score")
    {
      @Override
      public long getValue(@SuppressWarnings("unused") PairScore pair) {
        throw new UnsupportedOperationException("in this test, this method should not be called");
      }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.experiments.PairSelection.WekaDataCollector.PairRank

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.