Package org.encog.ml.data.basic

Examples of org.encog.ml.data.basic.BasicMLData


    System.out.println("Year\tActual\tPredict\tClosed Loop Predict");
   
    for(int year=EVALUATE_START;year<EVALUATE_END;year++)
    {
      // calculate based on actual data
      MLData input = new BasicMLData(WINDOW_SIZE);
      for(int i=0;i<input.size();i++)
      {
        input.setData(i,this.normalizedSunspots[(year-WINDOW_SIZE)+i]);
      }
      MLData output = network.compute(input);
      double prediction = output.getData(0);
      this.closedLoopSunspots[year] = prediction;
     
      // calculate "closed loop", based on predicted data
      for(int i=0;i<input.size();i++)
      {
        input.setData(i,this.closedLoopSunspots[(year-WINDOW_SIZE)+i]);
      }
      output = network.compute(input);
      double closedLoopPrediction = output.getData(0);
     
      // display
View Full Code Here


  public int scorePilot()
  {
    LanderSimulator sim = new LanderSimulator();
    while(sim.flying())
    {
      MLData input = new BasicMLData(3);
            input.setData(0, this.fuelStats.normalize(sim.getFuel()));
            input.setData(1, this.altitudeStats.normalize(sim.getAltitude()));
            input.setData(2, this.velocityStats.normalize(sim.getVelocity()));
            MLData output = this.network.compute(input);
            double value = output.getData(0);

            boolean thrust;
     
View Full Code Here

        }
    }
    private Object getNeuralNetworkTrainingData(NeuralData nd){
        MLDataSet trainingSet=new BasicMLDataSet();
       
        MLData mdInput=new BasicMLData(nd.getInputVector());
        MLData mdOuput=new BasicMLData(nd.getOutputVector());
       
               
        trainingSet.add(mdInput, mdOuput);
       
        return trainingSet;
View Full Code Here

       
        return trainingSet;
    }
   
    private Object getNeuralNetworkTrainingData(NeuralData nd,MLDataSet trainingSet){
        MLData mdInput=new BasicMLData(nd.getInputVector());
        MLData mdOuput=new BasicMLData(nd.getOutputVector());
       
               
        trainingSet.add(mdInput, mdOuput);
       
        return trainingSet;
View Full Code Here

   
    private Object getNeuralNetworkTrainingData(NeuralData [] ndArray){
        MLDataSet trainingSet=new BasicMLDataSet();
       
        for(int i=0;i<ndArray.length;i++){
            MLData mdInput=new BasicMLData(ndArray[i].getInputVector());
            MLData mdOuput=new BasicMLData(ndArray[i].getOutputVector());
   
            trainingSet.add(mdInput, mdOuput);
        }
        return trainingSet;
    }
View Full Code Here

    }
   
    private Object getNeuralNetworkTrainingData(NeuralData [] ndArray,MLDataSet trainingSet){

        for(int i=0;i<ndArray.length;i++){
            MLData mdInput=new BasicMLData(ndArray[i].getInputVector());
            MLData mdOuput=new BasicMLData(ndArray[i].getOutputVector());
   
            trainingSet.add(mdInput, mdOuput);
        }
        return trainingSet;
    }
View Full Code Here

        EncogDirectoryPersistence.saveObject(new File(saveFilePath), neuralNetwork);
    }
   
    public NeuralData calculateAndGetOuput(NeuralData nd){
       
        MLData mdInput=new BasicMLData(nd.getInputVector());
        MLData mdOutput=neuralNetwork.compute(mdInput);
       
       
        nd.setOutputVector(mdOutput.getData());
        return nd;
View Full Code Here

      if (this.series.getTotalDepth() > 1) {
        inputArray = this.series.process(inputArray);
      }

      if (inputArray != null) {
        final MLData input = new BasicMLData(inputArray);

        // evaluation data
        if ((method instanceof MLClassification)
            && !(method instanceof MLRegression)) {
          // classification only?
          output = new BasicMLData(1);
          output.setData(0,
              ((MLClassification) method).classify(input));
        } else {
          // regression
          output = ((MLRegression) method).compute(input);
View Full Code Here

          + " inputs, however, the data has " + this.inputCount
          + " inputs.");
    }

    MLData output = null;
    final MLData input = new BasicMLData(method.getInputCount());

    final PrintWriter tw = analystPrepareOutputFile(outputFile);

    resetStatus();
    while (csv.next()) {
      updateStatus(false);
      final LoadedRow row = new LoadedRow(csv, this.idealCount);

      int dataIndex = 0;
      // load the input data
      for (int i = 0; i < this.inputCount; i++) {
        final String str = row.getData()[i];
        final double d = getFormat().parse(str);
        input.setData(i, d);
        dataIndex++;
      }

      // do we need to skip the ideal values?
      dataIndex += this.idealCount;
View Full Code Here

    // process the output fields

    initForOutput();

    final MLData result = new BasicMLData(outputCount);

    // write the value
    int outputIndex = 0;
    for (final OutputField ofield : this.outputFields) {
      if (!ofield.isIdeal()) {
        for (int sub = 0; sub < ofield.getSubfieldCount(); sub++) {
          result.setData(outputIndex++, ofield.calculate(sub));
        }
      }
    }

    return result;
View Full Code Here

TOP

Related Classes of org.encog.ml.data.basic.BasicMLData

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.