Package shared

Examples of shared.AttrInfo


      attribMap.put(attrInfos.get(i).name(), new Pair<>(
          attrInfos.get(i), i));
    }

    // Create Attribute Information on label
    AttrInfo labelAttrib = new NominalAttrInfo(PERFORMANCE_CLASS, perfClasses);

    // Create MLJ meta information
    schema = new Schema(attrInfos, labelAttrib);
    InstanceList instances = createInstances(trainingData, attribMap);
View Full Code Here


      if (attrInfos == null) {
        throw new IllegalArgumentException("Attribute '" + confEntry.getKey()
            + "' could not be found in attrbute map!");
      }

      AttrInfo attrInfo = attrInfos.getFirstValue();
      AttrValue val = new AttrValue();

      if (attrInfo instanceof NominalAttrInfo) {
        attrInfo.set_nominal_string(val, confEntry.getValue().toString(), true);
      } else if (attrInfo instanceof RealAttrInfo) {
        attrInfo.set_real_val(val,
            ((Number) confEntry.getValue()).doubleValue());
      }

      instance.values[attrInfos.getSecondValue()] = val;
    }
View Full Code Here

   * @param attrInfos
   *          attribute information required for setting the value
   */
  static void setMissingAttribute(Instance instance,
      Pair<AttrInfo, Integer> attrInfos) {
    AttrInfo info = attrInfos.getFirstValue();
    int attribIndex = attrInfos.getSecondValue();
    AttrValue val = new AttrValue();

    if (info instanceof NominalAttrInfo) {
      info.set_nominal_string(val, MISSING_NOM_VAL, true);
    } else if (info instanceof RealAttrInfo) {
      info.set_real_val(val, MISSING_NUM_VAL);
    }

    instance.values[attribIndex] = val;
  }
View Full Code Here

TOP

Related Classes of shared.AttrInfo

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.