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


    super.setInputFormat(instanceInfo);

    m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
    if (!isNumeric() && !isNominal()) {
      throw new UnsupportedAttributeTypeException("Can only handle numeric " +
              "or nominal attributes.");
    }
    m_Values.setUpper(instanceInfo.attribute(m_AttIndex.getIndex()).numValues() - 1);
    if (isNominal() && m_ModifyHeader) {
      instanceInfo = new Instances(instanceInfo, 0); // copy before modifying
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

  }
  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

    break;
  case Attribute.NOMINAL:
    m_NominalBounds[i] = new boolean [instances.attribute(i).numValues()];
    break;
  default:
    throw new UnsupportedAttributeTypeException("Cannot process string attributes!");
  }
      }

      for (int i = 0; i < instances.numInstances(); i++) {
  addInstance(instances.instance(i));
View Full Code Here

    super.setInputFormat(instanceInfo);

    m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
    if (!isNumeric() && !isNominal()) {
      throw new UnsupportedAttributeTypeException("Can only handle numeric " +
              "or nominal attributes.");
    }
    m_Values.setUpper(instanceInfo.attribute(m_AttIndex.getIndex()).numValues() - 1);
    if (isNominal() && m_ModifyHeader) {
      instanceInfo = new Instances(instanceInfo, 0); // copy before modifying
View Full Code Here

      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()).isString()) {
      throw new UnsupportedAttributeTypeException("Chosen attribute is not of "
              + "type string.");
    }
    return false;
  }
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

       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

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.