Examples of MissingHandler


Examples of org.encog.ml.data.versatile.missing.MissingHandler

   * @param value The value to normalize.
   * @return The new current position in the vector.
   */
  public int normalizeToVector(ColumnDefinition colDef, int outputColumn,
      double[] output, boolean isInput, String value) {
    MissingHandler handler = null;

    if (this.unknownValues.contains(value)) {
      if (!this.missingHandlers.containsKey(colDef)) {
        throw new EncogError(
            "Do not know how to process missing value \"" + value
                + "\" in field: " + colDef.getName());
      }
      handler = this.missingHandlers.get(colDef);
    }

    if (colDef.getDataType() == ColumnType.continuous) {
      double d = parseDouble(value);
      if (handler != null) {
        d = handler.processDouble(colDef);
      }
      return this.normStrategy.normalizeColumn(colDef, isInput, d,
          output, outputColumn);
    } else {
      if (handler != null) {
        value = handler.processString(colDef);
      }
      return this.normStrategy.normalizeColumn(colDef, isInput, value,
          output, outputColumn);
    }
  }
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.