Package weka.core

Examples of weka.core.UnsupportedAttributeTypeException


      super.setInputFormat(instanceInfo);
     
      m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);

      if (!isNominal())
         throw new UnsupportedAttributeTypeException("Can only handle nominal attributes.");
     
      m_Values = null;
        
      return false;
   }
View Full Code Here


       throws Exception {

    super.setInputFormat(instanceInfo);
    m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
    if (!instanceInfo.attribute(m_AttIndex.getIndex()).isDate()) {
      throw new UnsupportedAttributeTypeException("Chosen attribute not date.");
    }

    setOutputFormat();
    return true;
  }
View Full Code Here

    super.setInputFormat(instanceInfo);
   
    m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
    att = instanceInfo.attribute(m_AttIndex.getIndex());
    if (!att.isNominal())
      throw new UnsupportedAttributeTypeException("Chosen attribute not nominal.");
   
    // merge labels
    allLabels = new Vector();
    enm = att.enumerateValues();
    while (enm.hasMoreElements())
View Full Code Here

  }
  result.append("    atts.addElement(new Attribute(\""
      + output.attribute(i).name() + "\", attValues));\n");
      }
      else {
  throw new UnsupportedAttributeTypeException(
      "Attribute type '" + output.attribute(i).type() + "' (position "
      + (i+1) + ") is not supported!");
      }
    }
    result.append("    \n");
View Full Code Here

            outputFormat.renameAttribute(i, outputFormat.attribute(i).name()
                                         + " d"
                                         + (m_InstanceRange < 0 ? '-' : '+')
                                         + Math.abs(m_InstanceRange));
          } else {
            throw new UnsupportedAttributeTypeException("Time delta attributes must be numeric!");
          }
        }
      }
    }
    outputFormat.setClassIndex(instanceInfo.classIndex());
View Full Code Here

    m_FirstIndex.setUpper(instanceInfo.
        attribute(m_AttIndex.getIndex()).numValues() - 1);
    m_SecondIndex.setUpper(instanceInfo.
         attribute(m_AttIndex.getIndex()).numValues() - 1);
    if (!instanceInfo.attribute(m_AttIndex.getIndex()).isNominal()) {
      throw new UnsupportedAttributeTypeException("Chosen attribute not nominal.");
    }
    if (instanceInfo.attribute(m_AttIndex.getIndex()).numValues() < 2) {
      throw new UnsupportedAttributeTypeException("Chosen attribute has less than "
              + "two values.");
    }
    setOutputFormat();
    return true;
  }
View Full Code Here

    super.setInputFormat(instanceInfo);
    m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
    m_ValIndex.setUpper(instanceInfo.attribute(m_AttIndex.
                 getIndex()).numValues() - 1);
    if (!instanceInfo.attribute(m_AttIndex.getIndex()).isNominal()) {
      throw new UnsupportedAttributeTypeException("Chosen attribute not nominal.");
    }
    if (instanceInfo.attribute(m_AttIndex.getIndex()).numValues() < 2) {
      throw new UnsupportedAttributeTypeException("Chosen attribute has less " +
              "than two values.");
    }
    setOutputFormat();
    return true;
  }
View Full Code Here

    int selectedCount = 0;
    for (int i = getInputFormat().numAttributes() - 1; i >= 0; i--) {
      if (m_DeltaCols.isInRange(i)) {
        selectedCount++;
        if (!getInputFormat().attribute(i).isNumeric()) {
          throw new UnsupportedAttributeTypeException("Selected attributes must be all numeric");
        }
      }
    }
    if (selectedCount == 1) {
      throw new Exception("Cannot select only one attribute.");
View Full Code Here

    m_MergeRange.setUpper(instanceInfo.attribute(m_AttIndex.getIndex()).numValues() - 1);
    if ((instanceInfo.classIndex() > -1) && (instanceInfo.classIndex() == m_AttIndex.getIndex())) {
      throw new Exception("Cannot process class attribute.");
    }
    if (!instanceInfo.attribute(m_AttIndex.getIndex()).isNominal()) {
      throw new UnsupportedAttributeTypeException("Chosen attribute not nominal.");
    }
    if (instanceInfo.attribute(m_AttIndex.getIndex()).numValues() < 2) {
      throw new UnsupportedAttributeTypeException("Chosen attribute has less than " +
      "two values.");
    }

    setOutputFormat();
    return true;
View Full Code Here

TOP

Related Classes of weka.core.UnsupportedAttributeTypeException

Copyright © 2018 www.massapicom. 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.