Examples of indexOfValue()


Examples of weka.core.Attribute.indexOfValue()

                  }
                } else {
                  // it is a nominal attribute in the mining schema so find
                  // the index that correponds to this value
                  Attribute att = miningSchemaI.attribute(p.m_miningSchemaIndex);
                  expOrIndex = att.indexOfValue(value);
                  if (expOrIndex == -1) {
                    throw new Exception("[GeneralRegression] unable to find PPCell value "
                                        + value + " in mining schema attribute "
                                        + att.name());
                  }
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

                              + paramName + " in parameter list");
        }

        if (targetCatName != null && targetCatName.length() > 0) {
          if (classAtt.isNominal() || classAtt.isString()) {
            targetCategoryIndex = classAtt.indexOfValue(targetCatName);
          } else {
            throw new Exception("[GeneralRegression] found a PCell with a named "
                                + "target category: " + targetCatName
                                + " but class attribute is numeric in "
                                + "mining schema");
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

      Attribute oldAtt = instanceInfo.attribute(m_AttIndex.getIndex());
      int [] selection = new int[m_Values.size()];
      Iterator iter = m_Values.iterator();
      int i = 0;
      while (iter.hasNext()) {
         selection[i] = oldAtt.indexOfValue(iter.next().toString());
         i++;
      }
      FastVector newVals = new FastVector();
      for (i = 0; i < selection.length; i++) {
         newVals.addElement(oldAtt.value(selection[i]));
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

            !newInstance.isMissing(i) &&
            m_AttIndices.isInRange(i)) {
          Attribute outAtt =
            getOutputFormat().attribute(newInstance.attribute(i).name());
          String inVal = newInstance.stringValue(i);
          int outIndex = outAtt.indexOfValue(inVal);
          if (outIndex < 0) {
            newInstance.setMissing(i);
          } else {
            newInstance.setValue(i, outIndex);
          }
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

    double newVal = value;
    if (m_missingValueTreatmentMethod != Missing.ASIS &&
        Instance.isMissingValue(value)) {
      if (m_missingValueReplacementNominal != null) {
        Attribute att = m_miningSchemaI.attribute(m_index);
        int valIndex = att.indexOfValue(m_missingValueReplacementNominal);
        if (valIndex < 0) {
          throw new Exception("[MiningSchema] Nominal missing value replacement value doesn't "
                              + "exist in the mining schema Instances!");
        }
        newVal = valIndex;
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

            // ignore
          }
          break;

        case Attribute.NOMINAL:
          if (att.indexOfValue(tmp) > -1)
            inst.setValue(index, att.indexOfValue(tmp));
          break;

        case Attribute.STRING:
          inst.setValue(index, tmp);
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

          }
          break;

        case Attribute.NOMINAL:
          if (att.indexOfValue(tmp) > -1)
            inst.setValue(index, att.indexOfValue(tmp));
          break;

        case Attribute.STRING:
          inst.setValue(index, tmp);
          break;
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

            // ignore
          }
          break;
     
        case Attribute.NOMINAL:
          if (att.indexOfValue(tmp) > -1)
            inst.setValue(index, att.indexOfValue(tmp));
          break;
     
        case Attribute.STRING:
          inst.setValue(index, tmp);
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

          }
          break;
     
        case Attribute.NOMINAL:
          if (att.indexOfValue(tmp) > -1)
            inst.setValue(index, att.indexOfValue(tmp));
          break;
     
        case Attribute.STRING:
          inst.setValue(index, tmp);
          break;
View Full Code Here

Examples of weka.core.Attribute.indexOfValue()

      Attribute oldAtt = instanceInfo.attribute(m_AttIndex.getIndex());
      int [] selection = new int[m_Values.size()];
      Iterator iter = m_Values.iterator();
      int i = 0;
      while (iter.hasNext()) {
         selection[i] = oldAtt.indexOfValue(iter.next().toString());
         i++;
      }
      FastVector newVals = new FastVector();
      for (i = 0; i < selection.length; i++) {
         newVals.addElement(oldAtt.value(selection[i]));
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.