Package weka.core

Examples of weka.core.Instance.stringValue()


    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.ZERO,instance.stringValue(classifier.attributesOfAnInstance[1]));
    Assert.assertTrue(classifier.attributesOfAnInstance[1].isNominal());
    Assert.assertEquals("REL another score",classifier.attributesOfAnInstance[1].name());

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


    Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(classifier.attributesOfAnInstance[1]));
    Assert.assertTrue(classifier.attributesOfAnInstance[1].isNominal());
    Assert.assertEquals("REL another score",classifier.attributesOfAnInstance[1].name());

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

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

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

    Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(classifier.attributesOfAnInstance[3]));
    Assert.assertTrue(classifier.attributesOfAnInstance[3].isNominal());
    Assert.assertEquals("another score",classifier.attributesOfAnInstance[3].name());
  }
 
 
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.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
View Full Code Here

 
      Assert.assertEquals(WekaDataCollector.ZERO,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
      Assert.assertEquals("REL statechum compatibility score",testClassifier.attributesOfAnInstance[1].name());
    }
   
    {// pairB - another correct pair
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.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
View Full Code Here

 
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
      Assert.assertEquals("REL statechum compatibility score",testClassifier.attributesOfAnInstance[1].name());
    }
   
    {// pairC - incorrect pair
View Full Code Here

      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(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
View Full Code Here

 
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[0].isNominal());
      Assert.assertEquals("REL statechum score",testClassifier.attributesOfAnInstance[0].name());
 
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
      Assert.assertTrue(testClassifier.attributesOfAnInstance[1].isNominal());
      Assert.assertEquals("REL statechum compatibility score",testClassifier.attributesOfAnInstance[1].name());
    }
   
    Assert.assertFalse(instEnum.hasMoreElements());
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

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.