Package weka.core

Examples of weka.core.Attribute.type()


    boolean bHasMissingValues = false;

    Enumeration enu = instances.enumerateAttributes();   
    while (enu.hasMoreElements()) {
      Attribute attribute = (Attribute) enu.nextElement();
      if (attribute.type() != Attribute.NOMINAL) {
  m_nNonDiscreteAttribute = attribute.index();
  bHasNonNominal = true;
  //throw new UnsupportedAttributeTypeException("BayesNet handles nominal variables only. Non-nominal variable in dataset detected.");
      }
      Enumeration enum2 = instances.enumerateInstances();
View Full Code Here


         
          Attribute modelAtt = m_modelHeader.attribute(i);
          Attribute incomingAtt = m_inputHeader.attribute(j);
         
          // check types
          if (modelAtt.type() != incomingAtt.type()) {
            m_attributeStatus[i] = TYPE_MISMATCH;
            break;
          }         
         
          // now check nominal values (number, names...)
View Full Code Here

      Attribute attribute = (Attribute) enu.nextElement();

      // If the attribute is numeric, determine the estimator
      // numeric precision from differences between adjacent values
      double numPrecision = DEFAULT_NUM_PRECISION;
      if (attribute.type() == Attribute.NUMERIC) {
  m_Instances.sort(attribute);
  if ((m_Instances.numInstances() > 0)
      && !m_Instances.instance(0).isMissing(attribute)) {
    double lastVal = m_Instances.instance(0).value(attribute);
    double currentVal, deltaSum = 0;
View Full Code Here

  }
      }


      for (int j = 0; j < m_Instances.numClasses(); j++) {
  switch (attribute.type()) {
  case Attribute.NUMERIC:
    if (m_UseKernelEstimator) {
      m_Distributions[attIndex][j] =
        new KernelEstimator(numPrecision);
    } else {
View Full Code Here

      for (int j = 0; j < dataSet.numAttributes(); j++) {
        if (dataSet.attribute(j).name().equals(schemaAttName)) {
          Attribute miningSchemaAtt = fieldsI.attribute(i);
          Attribute incomingAtt = dataSet.attribute(j);
          // check type match
          if (miningSchemaAtt.type() != incomingAtt.type()) {
            if (miningSchemaAtt.isString() && incomingAtt.isNominal()) {
              // don't worry about String attributes in the mining schema
              // (as long as the corresponding incoming is a String or nominal),
              // since values for the String attributes are more than likely revealed
              // by FieldRef elements in the actual model itself
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.