Package org.encog.app.analyst

Examples of org.encog.app.analyst.AnalystError


    } else if (cross.toLowerCase().startsWith("kfold:")) {
      final String str = cross.substring(6);
      try {
        return Integer.parseInt(str);
      } catch (final NumberFormatException ex) {
        throw new AnalystError("Invalid kfold :" + str);
      }
    } else {
      throw new AnalystError("Unknown cross validation: " + cross);
    }
  }
View Full Code Here


    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(resourceFile);

    if (!(method instanceof MLMethod)) {
      throw new AnalystError(
          "The object to be trained must be an instance of MLMethod. "
              + method.getClass().getSimpleName());
    }

    return method;
View Full Code Here

    for (final String line : section.getLines()) {
      if (!first) {
        final List<String> cols = EncogFileSection.splitColumns(line);

        if (cols.size() < COLUMN_FOUR) {
          throw new AnalystError("Invalid data class: " + line);
        }

        final String field = cols.get(0);
        final String code = cols.get(1);
        final String name = cols.get(2);
        final int count = Integer.parseInt(cols.get(3));

        final DataField df = this.script.findDataField(field);

        if (df == null) {
          throw new AnalystError(
              "Attempting to add class to unknown field: "
              + name);
        }

        List<AnalystClassItem> classItems;
View Full Code Here

        } else if (action.equals("single")) {
          des = NormalizationAction.SingleField;
        } else if (action.equals("oneof")) {
          des = NormalizationAction.OneOf;
        } else {
          throw new AnalystError("Unknown field type:" + action );
        }

        final AnalystField nf = new AnalystField(name, des, high, low);
        nf.setTimeSlice(timeSlice);
        nf.setOutput(isOutput);
View Full Code Here

  private void validateProperty(final String section,
      final String subSection, final String name, final String value) {
    final PropertyEntry entry = PropertyConstraints.getInstance().getEntry(
        section, subSection, name);
    if (entry == null) {
      throw new AnalystError("Unknown property: "
          + PropertyEntry.dotForm(section, subSection, name));
    }
    entry.validate(section, subSection, name, value);
  }
View Full Code Here

    final PropertyEntry entry = PropertyConstraints.getInstance()
        .findEntry(dots);

    if (entry == null) {
      throw new AnalystError("Unknown property: " + args.toUpperCase());
    }

    // strip quotes
    if (value.charAt(0) == '\"') {
      value = value.substring(1);
View Full Code Here

    final String targetFieldStr = getProp().getPropertyString(
        ScriptProperties.BALANCE_CONFIG_BALANCE_FIELD);
    final DataField targetFieldDF = getAnalyst().getScript().findDataField(
        targetFieldStr);
    if (targetFieldDF == null) {
      throw new AnalystError("Can't find balance target field: "
          + targetFieldStr);
    }
    if (!targetFieldDF.isClass()) {
      throw new AnalystError("Can't balance on non-class field: "
          + targetFieldStr);
    }

    final int targetFieldIndex = getAnalyst().getScript()
        .findDataFieldIndex(targetFieldDF);
View Full Code Here

  private void generateFieldsFromHeaders(final ReadCSV csv) {
    final CSVHeaders h = new CSVHeaders(csv.getColumnNames());
    this.fields = new AnalyzedField[csv.getColumnCount()];
    for (int i = 0; i < this.fields.length; i++) {
      if (i >= csv.getColumnNames().size()) {
        throw new AnalystError(
            "CSV header count does not match column count");
      }
      this.fields[i] = new AnalyzedField(this.script, h.getHeader(i));
    }
  }
View Full Code Here

        break;
      case SingleField:
        out.addColumn("single");
        break;
      default:
        throw new AnalystError("Unknown action: " + field.getAction());
      }

      out.addColumn(field.getNormalizedHigh());
      out.addColumn(field.getNormalizedLow());
      out.writeLine();
View Full Code Here

  private void generateFieldsFromHeaders(final ReadCSV csv) {
    final CSVHeaders h = new CSVHeaders(csv.getColumnNames());
    this.fields = new AnalyzedField[csv.getColumnCount()];
    for (int i = 0; i < this.fields.length; i++) {
      if (i >= csv.getColumnNames().size()) {
        throw new AnalystError(
            "CSV header count does not match column count");
      }
      this.fields[i] = new AnalyzedField(this.script, h.getHeader(i));
    }
  }
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.