Package org.encog.app.analyst

Examples of org.encog.app.analyst.AnalystError


    if( this.getGoal()==AnalystGoal.Classification) {
      arch.append(this.targetField.getClasses().size());
    } else if( this.getGoal()==AnalystGoal.Regression)  {
      arch.append(outputColumns);
    } else {
      throw new AnalystError("Unsupported goal type for PNN: " + this.getGoal().toString() );
    }

    this.script.getProperties().setProperty(
        ScriptProperties.ML_CONFIG_TYPE, MLMethodFactory.TYPE_PNN);
    this.script.getProperties().setProperty(
View Full Code Here


  public void produceReport(final File filename) {
    try {
      final String str = produceReport();
      FileUtil.writeFileAsString(filename, str);
    } catch (final IOException ex) {
      throw new AnalystError(ex);
    }
  }
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

    } 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

          } else {
            mapping = new VariableMapping(varName, ValueType.floatingType);
          }
          break;
        default:
          throw new AnalystError("Unknown normalization action: " + field.getAction().toString());
      }
     
      if( field.isOutput() ) {
        pop.getContext().setResult(mapping);
      } else {
View Full Code Here

   */
  public 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

        outputID);
   
    MLMethod m = (MLMethod) EncogDirectoryPersistence.loadObject(resourceFile);
   
    if( !(m instanceof MLRegression) ) {
      throw new AnalystError("The evaluate raw command can only be used with regression.");
    }

    final MLRegression method = (MLRegression)m;

    final boolean headers = getScript().expectInputHeaders(evalID);
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

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.