Package org.encog.neural.networks.training.cross

Examples of org.encog.neural.networks.training.cross.CrossValidationKFold


  }

  public void train(BasicNetwork network, MLDataSet training) {
    final FoldedDataSet folded = new FoldedDataSet(training);
    final MLTrain train = new ResilientPropagation(network, folded);
    final CrossValidationKFold trainFolded = new CrossValidationKFold(train,4);

    int epoch = 1;

    do {
      trainFolded.iteration();
      System.out
          .println("Epoch #" + epoch + " Error:" + trainFolded.getError());
      epoch++;
    } while (trainFolded.getError() > MAX_ERROR);
  }
View Full Code Here


    final FoldedDataSet folded = new FoldedDataSet(trainingData);
    return folded;
  }
 
  private MLTrain wrapTrainer(MLDataSet folded, MLTrain train, int foldCount) {
    final CrossValidationKFold trainFolded = new CrossValidationKFold(train,foldCount);
    return trainFolded;
  }
View Full Code Here

   
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
   
    final FoldedDataSet folded = new FoldedDataSet(trainingData);
    final MLTrain train = new ResilientPropagation(network, folded);
    final CrossValidationKFold trainFolded = new CrossValidationKFold(train,4);
   
    EncogUtility.trainToError(trainFolded, 0.2);
   
    XOR.verifyXOR((MLRegression)trainFolded.getMethod(), 0.2);
   
  }
View Full Code Here


    MLTrain train = factory.create(method, trainingSet, type, args);

    if (this.kfold > 0) {
      train = new CrossValidationKFold(train, this.kfold);
    }

    return train;
  }
View Full Code Here


    MLTrain train = factory.create(method, trainingSet, type, args);

    if ( getKfold() > 0) {
      train = new CrossValidationKFold(train, getKfold() );
    }

    return train;
  }
View Full Code Here

   
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
   
    final FoldedDataSet folded = new FoldedDataSet(trainingData);
    final MLTrain train = new ResilientPropagation(network, folded);
    final CrossValidationKFold trainFolded = new CrossValidationKFold(train,4);
   
    EncogUtility.trainToError(trainFolded, 0.2);
   
    XOR.verifyXOR((MLRegression)trainFolded.getMethod(), 0.2);
   
  }
View Full Code Here

TOP

Related Classes of org.encog.neural.networks.training.cross.CrossValidationKFold

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.