Package weka.core

Examples of weka.core.Instance.stringValue()


        Instance current = insts.instance(i);
        Instance next = insts.instance(i + 1);
        if (!Utils.isMissingValue(current.value(primaryIndex))
            && !Utils.isMissingValue(next.value(primaryIndex))) {
          String key = current.stringValue(primaryIndex);
          String value = next.stringValue(primaryIndex);
          if (m_primaryPeriodicSequence.get(key) == null) {
            m_primaryPeriodicSequence.put(key, value);
          } else {
            // check to see if this value is consistent with
            // what we've seen previously
View Full Code Here


            Map<String, String> candidateMap = new HashMap<String, String>();
            for (int j = 0; j < insts.numInstances(); j++) {
              Instance current = insts.instance(j);
              if (!Utils.isMissingValue(current.value(primaryIndex))
                  && !Utils.isMissingValue(j)) {
                String key = current.stringValue(primaryIndex);
                String value = current.stringValue(j);

                if (candidateMap.get(key) == null) {
                  candidateMap.put(key, value);
                } else {
View Full Code Here

            for (int j = 0; j < insts.numInstances(); j++) {
              Instance current = insts.instance(j);
              if (!Utils.isMissingValue(current.value(primaryIndex))
                  && !Utils.isMissingValue(j)) {
                String key = current.stringValue(primaryIndex);
                String value = current.stringValue(j);

                if (candidateMap.get(key) == null) {
                  candidateMap.put(key, value);
                } else {
                  // check to see if this value is consistent with what
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

    Enumeration<Instance> instEnum = testClassifier.trainingData.enumerateInstances();

    {// pairA - the correct pair
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
    }
   
    {// pairB - another correct pair
      Instance instance = instEnum.nextElement();
View Full Code Here

    {// pairA - the correct pair
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
      Assert.assertEquals(WekaDataCollector.ONE,instance.stringValue(testClassifier.attributesOfAnInstance[0]));
      Assert.assertEquals(WekaDataCollector.MINUSONE,instance.stringValue(testClassifier.attributesOfAnInstance[1]));
    }
   
    {// pairB - another correct pair
      Instance instance = instEnum.nextElement();
      Assert.assertEquals("true",instance.classAttribute().value((int) instance.value(instance.classAttribute())));
View Full Code Here

    }
   
    {// pairB - another correct pair
      Instance instance = instEnum.nextElement();
      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]));
    }
   
    {// pairC - incorrect pair
      Instance instance = instEnum.nextElement();
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.