Examples of calculateError()


Examples of org.encog.ml.fitting.linear.LinearRegression.calculateError()

    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
   
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
 
  public void testLinear2() {
    double[][] INPUT = { {2}, {4}, {6}, {8} };
    double[][] IDEAL = { {2}, {5}, {5}, {8} };
View Full Code Here

Examples of org.encog.ml.fitting.linear.LinearRegression.calculateError()

    LinearRegression lin = new LinearRegression(1);
    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
}
View Full Code Here

Examples of org.encog.ml.svm.SVM.calculateError()

      SVM method = (SVM) file.getObject();
      SVMTrain train = new SVMTrain((SVM) method, trainingData);
      train.setC(c);
      train.setGamma(g);
      train.iteration();
      double error = method.calculateError(trainingData);
      if (EncogWorkBench.askQuestion("Training Done",
          "Error: " + Format.formatPercent(error)
              + "\nSave training?")) {
        file.save();
      }
View Full Code Here

Examples of org.encog.neural.neat.NEATNetwork.calculateError()

    } while(train.getError() > 0.01 && train.getIteration()<10000);
    Encog.getInstance().shutdown();
    NEATNetwork network = (NEATNetwork)train.getCODEC().decode(train.getBestGenome());
   
    Assert.assertTrue(train.getError()<0.01);
    Assert.assertTrue(network.calculateError(buffer)<0.01);
  }
 
  public void testNEAT() {
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);
    NEATPopulation pop = new NEATPopulation(2,1,1000);
View Full Code Here

Examples of org.encog.neural.neat.NEATNetwork.calculateError()

    // test the neural network
    Encog.getInstance().shutdown();
    Assert.assertTrue(train.getError()<0.01);
    NEATNetwork network = (NEATNetwork)train.getCODEC().decode(train.getBestGenome());
    Assert.assertTrue(network.calculateError(trainingSet)<0.01);
  }
}
View Full Code Here

Examples of org.encog.neural.networks.BasicNetwork.calculateError()

   
    // train the neural network
    EncogUtility.trainConsole( jordanNetwork, trainingSet, 1);
    EncogUtility.trainConsole( ffNetwork, trainingSet, 1);
   
    System.out.println("Final Jordan Error: " + Format.formatPercent(jordanNetwork.calculateError(trainingSet)));
    System.out.println("Final Feedforwd Error: " + Format.formatPercent(jordanNetwork.calculateError(trainingSet)));
   
    System.out.println("However, the error rate can be misleading.  Consider the evaluations of each network.");
   
    System.out.println("Feedforward Evaluation:");
View Full Code Here

Examples of org.encog.neural.networks.BasicNetwork.calculateError()

    // train the neural network
    EncogUtility.trainConsole( jordanNetwork, trainingSet, 1);
    EncogUtility.trainConsole( ffNetwork, trainingSet, 1);
   
    System.out.println("Final Jordan Error: " + Format.formatPercent(jordanNetwork.calculateError(trainingSet)));
    System.out.println("Final Feedforwd Error: " + Format.formatPercent(jordanNetwork.calculateError(trainingSet)));
   
    System.out.println("However, the error rate can be misleading.  Consider the evaluations of each network.");
   
    System.out.println("Feedforward Evaluation:");
    EncogUtility.evaluate(ffNetwork, trainingSet);
View Full Code Here

Examples of org.encog.neural.networks.BasicNetwork.calculateError()

    do {
      train.iteration();
    } while (train.getError() > 0.009);

    double e = network.calculateError(trainingSet);
    System.out.println("Network traiined to error: " + e);

    System.out.println("Saving network");
    SerializeObject.save(new File(FILENAME), network);
  }
View Full Code Here

Examples of org.encog.neural.networks.BasicNetwork.calculateError()

  public void loadAndEvaluate() throws IOException, ClassNotFoundException {
    System.out.println("Loading network");
    BasicNetwork network = (BasicNetwork) SerializeObject.load(new File(FILENAME));
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
    double e = network.calculateError(trainingSet);
    System.out
        .println("Loaded network's error is(should be same as above): "
            + e);
  }
View Full Code Here

Examples of org.encog.neural.networks.BasicNetwork.calculateError()

          .println("Epoch #" + epoch + " Error:" + train.getError());
      epoch++;
    } while(train.getError() > 0.01);
   
    //
    System.out.println("Error:" + network.calculateError(training));
   
    // test it
    for(int i=0;i<DIGITS.length;i++)
    {
      int output = network.winner(image2data(DIGITS[i]));
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.