Package org.encog.ml.data.basic

Examples of org.encog.ml.data.basic.BasicMLDataSet$BasicMLIterator


  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  private NEATPopulation generate()
  {
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);
   
    CalculateScore score = new TrainingSetScore(trainingSet);
    // train the neural network
    ActivationStep step = new ActivationStep();
    step.setCenter(0.5);
View Full Code Here


    Assert.assertEquals(0.2,pop.getSurvivalRate());
    Assert.assertEquals(10,pop.getYoungBonusAgeThreshold());
    Assert.assertEquals(0.3,pop.getYoungScoreBonus());
   
    // see if the population can actually be used to train
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);   
    CalculateScore score = new TrainingSetScore(trainingSet);
    NEATTraining train = new NEATTraining(score,pop);
    train.iteration();

  }
View Full Code Here

        {1,2,3},
        {3,2,1} };
 
    public void testCluster (){
               
        BasicMLDataSet set = new BasicMLDataSet();
       
        for(int i=0;i<DATA.length;i++)
        {
          set.add(new BasicMLData(DATA[i]));
        }

        KMeansClustering kmeans = new KMeansClustering(2,set);
       
        kmeans.iteration(100);
View Full Code Here

  public BasicPNN create() {
    PNNOutputMode mode = PNNOutputMode.Regression;

    BasicPNN network = new BasicPNN(PNNKernelType.Gaussian, mode, 2, 1);

    BasicMLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);

    System.out.println("Learning...");

    TrainBasicPNN train = new TrainBasicPNN(network, trainingSet);
View Full Code Here

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  private SVM create()
  {
    MLDataSet training = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    SVM result = new SVM(2,SVMType.EpsilonSupportVectorRegression,KernelType.RadialBasisFunction);
    final SVMTrain train = new SVMTrain(result, training);
    train.iteration();
    return result;
  }
View Full Code Here

    generateTraining();
   
    BasicNetwork ffNetwork = createFeedForward()
    BasicNetwork jordanNetwork = createJordan();
   
    MLDataSet trainingSet = new BasicMLDataSet(this.input, this.ideal);
   
    // train the neural network
    EncogUtility.trainConsole( jordanNetwork, trainingSet, 1);
    EncogUtility.trainConsole( ffNetwork, trainingSet, 1);
   
View Full Code Here

   * Process the array.
   * @param data The array to process.
   * @return A neural data set that contains the time-series.
   */
  public final MLDataSet process(final double[] data) {
    final MLDataSet result = new BasicMLDataSet();

    final int totalWindowSize = this.inputWindow + this.predictWindow;
    final int stopPoint = data.length - totalWindowSize;

    for (int i = 0; i < stopPoint; i++) {
      final MLData inputData
        = new BasicMLData(this.inputWindow);
      final MLData idealData
        = new BasicMLData(this.predictWindow);

      int index = i;

      // handle input window
      for (int j = 0; j < this.inputWindow; j++) {
        inputData.setData(j, data[index++]);
      }

      // handle predict window
      for (int j = 0; j < this.predictWindow; j++) {
        idealData.setData(j, data[index++]);
      }

      final MLDataPair pair = new BasicMLDataPair(inputData,
          idealData);
      result.add(pair);
    }

    return result;
  }
View Full Code Here

      network.getStructure().finalizeStructure();
      network.reset();
      (new ConsistentRandomizer(0,0.5,i)).randomize(network);

      // create training data
      MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);

      // train the neural network
      final ResilientPropagation train = new ResilientPropagation(network, trainingSet);
      train.setRPROPType(RPROPType.iRPROPp);
View Full Code Here

   * Create a dataset from the clustered data.
   * @return The dataset.
   */
  @Override
  public final MLDataSet createDataSet() {
    final MLDataSet result = new BasicMLDataSet();

    for (final MLData dataItem : this.data) {
      result.add(dataItem);
    }

    return result;
  }
View Full Code Here

   * The main method.
   * @param args Arguments are not used.
   */
  public static void main(final String args[]) {

    final BasicMLDataSet set = new BasicMLDataSet();

    for (final double[] element : SimpleKMeans.DATA) {
      set.add(new BasicMLData(element));
    }

    final KMeansClustering kmeans = new KMeansClustering(2, set);

    kmeans.iteration(100);
View Full Code Here

TOP

Related Classes of org.encog.ml.data.basic.BasicMLDataSet$BasicMLIterator

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.