Package weka.core

Examples of weka.core.Instance.numValues()


      Assert.assertEquals("REL statechum compatibility score",testClassifier.attributesOfAnInstance[1].name());
    }
   
    {// pairC - incorrect pair
      Instance instance = instEnum.nextElement();
      Assert.assertFalse(instance.classIsMissing());Assert.assertEquals(5,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())));
 
View Full Code Here


        Instance temp = (Instance)enu.nextElement();
        logger.info("Parsing " + temp);
        String[] feedbackInstance = new String[3];
        //go through each feedback line
       
        if(temp.numValues()!=3) throw new GenericTestbedException("Reputation line does not have 3 elements. This is illegal.");
       
        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 3
          feedbackInstance[i] = temp.stringValue(i);         
View Full Code Here

        String[] feedbackInstance = new String[3];
        //go through each feedback line
       
        if(temp.numValues()!=3) throw new GenericTestbedException("Reputation line does not have 3 elements. This is illegal.");
       
        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 3
          feedbackInstance[i] = temp.stringValue(i);         
        }
        Agent src = new Agent(new Integer(feedbackInstance[0]));
View Full Code Here

       
    Enumeration enu = instances.enumerateInstances();
    while(enu.hasMoreElements())
    {
      Instance temp = (Instance)enu.nextElement();
      for(int i=0;i<temp.numValues();i++)
      {
        System.out.println(temp.stringValue(i));
      }
    }
    //System.out.println(instances.instance(0).stringValue(2));
View Full Code Here

        Instance temp = (Instance)enu.nextElement();
        logger.info("Parsing " + temp);
        String[] feedbackInstance = new String[3];
        //go through each feedback line
       
        if(temp.numValues()!=2) throw new GenericTestbedException("Trust line does not have 2 elements. This is illegal.");
       
        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 2
          feedbackInstance[i] = temp.stringValue(i);         
View Full Code Here

        String[] feedbackInstance = new String[3];
        //go through each feedback line
       
        if(temp.numValues()!=2) throw new GenericTestbedException("Trust line does not have 2 elements. This is illegal.");
       
        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 2
          feedbackInstance[i] = temp.stringValue(i);         
        }
        Agent src = new Agent(new Integer(feedbackInstance[0]));
View Full Code Here

    Enumeration enu = instances.enumerateInstances();
    while(enu.hasMoreElements())
    {
      Instance temp = (Instance)enu.nextElement();
      logger.info("Parsing " + temp);
      if(temp.numValues()!=4) throw new Exception("Strategy line does not have 3 elements. This is illegal.");
      Double[] strategyInstance = new Double[4];
      for(int i=0;i<temp.numValues();i++)
      {
        //number of values == 4
        strategyInstance[i] = temp.value(i);     
View Full Code Here

    {
      Instance temp = (Instance)enu.nextElement();
      logger.info("Parsing " + temp);
      if(temp.numValues()!=4) throw new Exception("Strategy line does not have 3 elements. This is illegal.");
      Double[] strategyInstance = new Double[4];
      for(int i=0;i<temp.numValues();i++)
      {
        //number of values == 4
        strategyInstance[i] = temp.value(i);     
        if(strategyInstance[i]==null) throw new Exception("A parameter in strategy line is null.");
      }
View Full Code Here

    enu = instances.enumerateInstances();
    while(enu.hasMoreElements())
    {
      Instance temp = (Instance)enu.nextElement();
      logger.info("Parsing " + temp);
      if(temp.numValues()!=2) throw new Exception("Group line does not have 2 elements. This is illegal.");
      Double[] groupInstance = new Double[2];
      for(int i=0;i<temp.numValues();i++)
      {
        //number of values == 2
        groupInstance[i] = temp.value(i);   
View Full Code Here

    {
      Instance temp = (Instance)enu.nextElement();
      logger.info("Parsing " + temp);
      if(temp.numValues()!=2) throw new Exception("Group line does not have 2 elements. This is illegal.");
      Double[] groupInstance = new Double[2];
      for(int i=0;i<temp.numValues();i++)
      {
        //number of values == 2
        groupInstance[i] = temp.value(i);   
        if(groupInstance[i]==null) throw new Exception("A parameter in group line is null.");
      }
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.