Package org.encog.app.analyst

Examples of org.encog.app.analyst.AnalystError


    for (final AnalystField norm : this.normalizedFields) {
      final DataField f = script.findDataField(norm.getName());

      if (f == null) {
        throw new AnalystError("Normalize specifies unknown field: "
            + norm.getName());
      }

      if (norm.getAction() == NormalizationAction.Normalize) {
        norm.setActualHigh(f.getMax());
View Full Code Here


    for (String line : this.lines) {
      line = line.trim();
      if (line.length() > 0) {
        final int idx = line.indexOf('=');
        if (idx == -1) {
          throw new AnalystError("Invalid setup item: " + line);
        }
        final String name = line.substring(0, idx).trim();
        final String value = line.substring(idx + 1).trim();

        result.put(name, value);
View Full Code Here

        file.delete();
        tempFile.renameTo(file);
      }

    } catch (final IOException e) {
      throw new AnalystError(e);
    }
  }
View Full Code Here

   */
  public final int find(final String name) {
    String key = name.toLowerCase();
   
    if (!this.columnMapping.containsKey(key)) {
      throw new AnalystError("Can't find column: " + name.toLowerCase());
    }

    return this.columnMapping.get(key);
  }
View Full Code Here

          continue;
        }

        if (this.headerList.get(i).equalsIgnoreCase(
            this.headerList.get(j))) {
          throw new AnalystError("Multiple fields named: "
              + this.headerList.get(i));
        }
      }
    }
  }
View Full Code Here

   * @param input The input.
   * @return The output.
   */
  public final double[] process(final double[] input) {
    if (input.length != this.inputSize) {
      throw new AnalystError("Invalid input size: " + input.length
          + ", should be " + this.inputSize);
    }

    this.buffer.add(0, EngineArray.arrayCopy(input));

    // are we ready yet?
    if (this.buffer.size() < this.totalDepth) {
      return null;
    }

    // create output
    final double[] output = new double[this.outputSize];

    int outputIndex = 0;
    for (final AnalystField field : this.analyst.getScript().getNormalize()
        .getNormalizedFields()) {
      if (!field.isIgnored()) {
        if (!this.headingMap.containsKey(field.getName())) {
          throw new AnalystError("Undefined field: "
              + field.getName());
        }
        final int headingIndex = this.headingMap.get(field.getName());
        final int timeslice = translateTimeSlice(field.getTimeSlice());
        final double[] row = this.buffer.get(timeslice);
View Full Code Here

    this.idealCount = getInputHeadings().length - this.inputCount;

    if ((getInputHeadings().length != this.inputCount)
        && (getInputHeadings().length
            != (this.inputCount + this.outputCount))) {
      throw new AnalystError("Invalid number of columns("
          + getInputHeadings().length + "), must match input("
          + this.inputCount + ") count or input+output("
          + (this.inputCount + this.outputCount) + ") count.");
    }
View Full Code Here

    final ReadCSV csv = new ReadCSV(getInputFilename().toString(),
        isExpectInputHeaders(), getInputFormat());

    if (method.getInputCount() != this.inputCount) {
      throw new AnalystError("This machine learning method has "
          + method.getInputCount()
          + " inputs, however, the data has " + this.inputCount
          + " inputs.");
    }
View Full Code Here

          }
        }
      }

      if (!success) {
        throw new AnalystError(
            "Can't determine target field automatically, "
          + "please specify one.\nThis can also happen if you "
            + "specified the wrong file format.");
      }
    } else {
      if (this.script.findDataField(this.targetField) == null) {
        throw new AnalystError("Invalid target field: "
            + this.targetField);
      }
    }

    this.script.getProperties().setProperty(
View Full Code Here

   */
  private void generateGenerate() {
    determineTargetField();

    if (this.targetField == null) {
      throw new AnalystError(
          "Failed to find normalized version of target field: "
              + this.targetField);
    }

    final int inputColumns = this.script.getNormalize()
        .calculateInputColumns();
    final int idealColumns = this.script.getNormalize()
        .calculateOutputColumns();

    switch (this.methodType) {
    case FeedForward:
      generateFeedForward(inputColumns, idealColumns);
      break;
    case SVM:
      generateSVM(inputColumns, idealColumns);
      break;
    case RBF:
      generateRBF(inputColumns, idealColumns);
      break;
    case SOM:
      generateSOM(inputColumns);
      break;
    default:
      throw new AnalystError("Unknown method type");
    }
  }
View Full Code Here

TOP

Related Classes of org.encog.app.analyst.AnalystError

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.