Examples of numAttributes()


Examples of weka.core.Instances.numAttributes()

        data.setClassIndex(data.numAttributes() - 1);
      data.deleteWithMissingClass();

      // count numeric and nominal attributes
      int numNumeric = 0, numNominal = 0;
      for (int i = 0; i < data.numAttributes(); i++) {
        if ( data.classIndex()==i )
          continue;
        if ( data.attribute(i).isNominal() )
          numNominal++;
        if ( data.attribute(i).isNumeric() )
View Full Code Here

Examples of weka.core.Instances.numAttributes()

   * @return the dataset
   */
  public static Instances readInstances(String location) throws Exception {
    Instances data = new weka.core.converters.ConverterUtils.DataSource(location).getDataSet();
    if (data.classIndex() == -1)
      data.setClassIndex(data.numAttributes() - 1);
    return data;
  }
}
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        m_createDate = m_createDate.toUpperCase();
      }
      m_resolvedTableName = m_resolvedTableName.replaceAll("[^\\w]","_");
      m_resolvedTableName = m_DataBaseConnection.maskKeyword(m_resolvedTableName);
      query.append(m_resolvedTableName);
      if(structure.numAttributes() == 0)
          throw new Exception("Instances have no attribute.");
      query.append(" ( ");
      if(m_id){
        if(m_DataBaseConnection.getUpperCase())
              m_idColumn = m_idColumn.toUpperCase();
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        query.append(m_DataBaseConnection.maskKeyword(m_idColumn));
        query.append(" ");
        query.append(m_createInt);
        query.append(" PRIMARY KEY,");
      }
      for(int i = 0;i < structure.numAttributes(); i++){
          Attribute att = structure.attribute(i);
          String attName = att.name();
          attName = attName.replaceAll("[^\\w]","_");
          attName = m_DataBaseConnection.maskKeyword(attName);
          if(m_DataBaseConnection.getUpperCase())
View Full Code Here

Examples of weka.core.Instances.numAttributes()

              if(att.isNumeric())
                  query.append(" "+m_createDouble);
              else
                  query.append(" "+m_createText);
          }
          if(i != structure.numAttributes()-1)
              query.append(", ");
      }
      query.append(" )");
      //System.out.println(query.toString());
      m_DataBaseConnection.update(query.toString());
View Full Code Here

Examples of weka.core.Instances.numAttributes()

    // create nodes first
    NodeList nodelist = doc.getElementsByTagName("VARIABLE");
    FastVector sBaseNames = new FastVector();
    Instances instances = new Instances(m_Instances, 0);
    int nBase = instances.numAttributes();
    for (int iNode = 0; iNode < nodelist.getLength(); iNode++) {
      // Get element
      FastVector valueslist;
      // Get the name of the node
      valueslist = selectElements(nodelist.item(iNode), "OUTCOME");
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        sNodeName = "Copy (" + iAttempt + ") of " + sBaseName;
        iAttempt++;
      }

      Attribute att = new Attribute(sNodeName, nomStrings);
      instances.insertAttributeAt(att, instances.numAttributes());

      valueslist = selectElements(nodelist.item(iNode), "PROPERTY");
      nValues = valueslist.size();
      // generate value strings
      int nPosX = iAttempt * 10;
 
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.