org.encog.neural.networks.training.cross
Class CrossValidationKFold
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.neural.networks.training.cross.CrossTraining
-
- org.encog.neural.networks.training.cross.CrossValidationKFold
-
- All Implemented Interfaces:
- MLTrain
public class CrossValidationKFold extends CrossTraining
Train using K-Fold cross validation. Each iteration will train a number of times equal to the number of folds - 1. Each of these sub iterations will train all of the data minus the fold. The fold is used to validate. Therefore, you are seeing an error that reflects data that was not always used as part of training. This should give you a better error result based on how the network will perform on non-trained data.(validation). The cross validation trainer must be provided with some other sort of trainer, perhaps RPROP, to actually perform the training. The training data must be the FoldedDataSet. The folded dataset can wrap most other training sets.
-
-
Constructor Summary
Constructors Constructor and Description CrossValidationKFold(MLTrain train, int k)Construct a cross validation trainer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()intgetIteration()voiditeration()Perform one iteration.TrainingContinuationpause()Pause the training to continue later.voidresume(TrainingContinuation state)Resume training.-
Methods inherited from class org.encog.neural.networks.training.cross.CrossTraining
getFolded, getMethod
-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, finishTraining, getError, getImplementationType, getStrategies, getTraining, isTrainingDone, iteration, postIteration, preIteration, setError, setIteration, setTraining
-
-
-
-
Constructor Detail
-
CrossValidationKFold
public CrossValidationKFold(MLTrain train, int k)
Construct a cross validation trainer.- Parameters:
train- The trainingk- The number of folds.
-
-
Method Detail
-
iteration
public void iteration()
Perform one iteration.
-
canContinue
public boolean canContinue()
- Returns:
- True if the training can be paused, and later continued.
-
pause
public TrainingContinuation pause()
Pause the training to continue later.- Returns:
- A training continuation object.
-
resume
public void resume(TrainingContinuation state)
Resume training.- Parameters:
state- The training continuation object to use to continue.
-
getIteration
public int getIteration()
- Specified by:
getIterationin interfaceMLTrain- Overrides:
getIterationin classBasicTraining- Returns:
- the iteration
-
-
DMelt 3.0 © DataMelt by jWork.ORG