Package org.encog.engine.util

Examples of org.encog.engine.util.ErrorCalculation


   * @param data
   *            The training set.
   * @return The error percentage.
   */
  public double calculateError(final EngineIndexableSet data) {
    final ErrorCalculation errorCalculation = new ErrorCalculation();

    final double[] actual = new double[this.outputCount];
    final EngineData pair = BasicEngineData.createPair(data.getInputSize(),
        data.getIdealSize());

    for (int i = 0; i < data.getRecordCount(); i++) {
      data.getRecord(i, pair);
      compute(pair.getInputArray(), actual);
      errorCalculation.updateError(actual, pair.getIdealArray());
    }
    return errorCalculation.calculate();
  }
View Full Code Here


  /**
   * @return The error from the last evaluation.
   */
  public double getError() {
    ErrorCalculation ec = new ErrorCalculation();
    double result = 0;
    for (int i = 0; i < this.errors.length; i++) {
      result += this.errors[i];
    }
    return result/(this.errors.length*this.flat.getOutputCount());
 
View Full Code Here

TOP

Related Classes of org.encog.engine.util.ErrorCalculation

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.