Package weka.core

Examples of weka.core.Instance.stringValue()


      Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));

      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[2]));
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[3]));
    }
   
    {// pairC - incorrect pair, only compared with A and B
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
View Full Code Here


    }
   
    {// pairC - incorrect pair, only compared with A and B
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));

      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[2]));
      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[3]));
    }
View Full Code Here

   
    {// pairC - incorrect pair, only compared with A and B
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));

      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[2]));
      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[3]));
    }
   
View Full Code Here

      Instance instance = instEnum.nextElement();
      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));

      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[2]));
      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[3]));
    }
   
    {// pairD - incorrect pair, compared only with E
      Instance instance = instEnum.nextElement();
View Full Code Here

      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));

      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[2]));
      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[3]));
    }
   
    {// pairD - incorrect pair, compared only with E
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
View Full Code Here

    Assert.assertFalse(instance.classIsMissing());Assert.assertEquals(1,instance.numValues());
    Assert.assertFalse(instance.hasMissingValue());
    Assert.assertTrue(instance.classAttribute().isNominal());
    Assert.assertEquals(2,instance.classAttribute().numValues());// true/false
    Assert.assertEquals("false",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
    Assert.assertEquals("false",instance.stringValue(instance.classAttribute()));
  }
 
  /** Construction of instances. */
  @Test
  public void testConstructEmptyInstance2a()
View Full Code Here

    Assert.assertFalse(instance.classIsMissing());Assert.assertEquals(3,instance.numValues());
    Assert.assertFalse(instance.hasMissingValue());
    Assert.assertTrue(instance.classAttribute().isNominal());
    Assert.assertEquals(2,instance.classAttribute().numValues());// true/false
    Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
    Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(classifier.attributesOfAnInstance[0]));
    Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(classifier.attributesOfAnInstance[1]));
  }

  /** Construction of instances. Same as TestCreateInstances2 but initialises with zero max number of values in the training set. */
  @Test
 
View Full Code Here

    Assert.assertFalse(instance.hasMissingValue());
    Assert.assertTrue(instance.classAttribute().isNominal());
    Assert.assertEquals(2,instance.classAttribute().numValues());// true/false
    Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
    Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(classifier.attributesOfAnInstance[0]));
    Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(classifier.attributesOfAnInstance[1]));
  }

  /** Construction of instances. Same as TestCreateInstances2 but initialises with zero max number of values in the training set. */
  @Test
  public void TestCreateInstances3()
View Full Code Here

    Assert.assertFalse(instance.hasMissingValue());
    Assert.assertTrue(instance.classAttribute().isNominal());
    Assert.assertEquals(2,instance.classAttribute().numValues());// true/false
    Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));

    Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(classifier.attributesOfAnInstance[0]));
    Assert.assertTrue(classifier.attributesOfAnInstance[0].isNominal());
    Assert.assertEquals("REL conventional score",classifier.attributesOfAnInstance[0].name());

    Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(classifier.attributesOfAnInstance[1]));
    Assert.assertTrue(classifier.attributesOfAnInstance[1].isNominal());
View Full Code Here

    Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(classifier.attributesOfAnInstance[0]));
    Assert.assertTrue(classifier.attributesOfAnInstance[0].isNominal());
    Assert.assertEquals("REL conventional score",classifier.attributesOfAnInstance[0].name());

    Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(classifier.attributesOfAnInstance[1]));
    Assert.assertTrue(classifier.attributesOfAnInstance[1].isNominal());
    Assert.assertEquals("conventional score",classifier.attributesOfAnInstance[1].name());
  }
 
  /** Construction of instances. Invalid value for an attribute. */
 
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.