org.encog.ml.ea.train.basic
public class TrainEA extends BasicEA implements MLTrain
Constructor and Description |
---|
TrainEA(Population thePopulation,
CalculateScore theScoreFunction)
Create a trainer for a score function.
|
TrainEA(Population thePopulation,
MLDataSet trainingData)
Create a trainer for training data.
|
Modifier and Type | Method and Description |
---|---|
void |
addStrategy(Strategy strategy)
Training strategies can be added to improve the training results.
|
boolean |
canContinue() |
void |
finishTraining()
Called when training is finished.
|
TrainingImplementationType |
getImplementationType() |
MLMethod |
getMethod()
Get the current best machine learning method from the training.
|
List<Strategy> |
getStrategies() |
MLDataSet |
getTraining()
Returns null, does not use a training set, rather uses a score function.
|
boolean |
isTrainingDone() |
void |
iteration()
Perform a training iteration.
|
void |
iteration(int count)
Perform the specified number of training iterations.
|
TrainingContinuation |
pause()
Pause the training to continue later.
|
void |
postIteration()
Call the strategies after an iteration.
|
void |
preIteration()
Call the strategies before an iteration.
|
void |
resume(TrainingContinuation state)
Resume training.
|
void |
setError(double error)
Not used.
|
addChild, addOperation, addScoreAdjuster, calculateScore, calculateScoreAdjustment, getBestComparator, getBestGenome, getChampMutation, getCODEC, getEliteRate, getError, getIteration, getMaxIndividualSize, getMaxOperationErrors, getMaxTries, getOldBestGenome, getOperators, getPopulation, getRandomNumberFactory, getRules, getScoreAdjusters, getScoreFunction, getSelection, getSelectionComparator, getShouldIgnoreExceptions, getSpeciation, getThreadCount, isValidationMode, performShutdownTask, reportError, setBestComparator, setChampMutation, setCODEC, setEliteRate, setIteration, setMaxOperationErrors, setMaxTries, setPopulation, setRandomNumberFactory, setRules, setSelection, setSelectionComparator, setShouldIgnoreExceptions, setSpeciation, setThreadCount, setValidationMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getError, getIteration, setIteration
public TrainEA(Population thePopulation, CalculateScore theScoreFunction)
thePopulation
- The population.theScoreFunction
- The score function.public TrainEA(Population thePopulation, MLDataSet trainingData)
thePopulation
- The population.trainingData
- The training data.public void setError(double error)
public boolean isTrainingDone()
isTrainingDone
in interface MLTrain
public TrainingImplementationType getImplementationType()
getImplementationType
in interface MLTrain
public void iteration(int count)
public TrainingContinuation pause()
public void resume(TrainingContinuation state)
public void addStrategy(Strategy strategy)
addStrategy
in interface MLTrain
strategy
- The strategy to add.public boolean canContinue()
canContinue
in interface MLTrain
public void finishTraining()
finishTraining
in interface EvolutionaryAlgorithm
finishTraining
in interface MLTrain
finishTraining
in class BasicEA
public MLMethod getMethod()
MLTrain
public MLDataSet getTraining()
getTraining
in interface MLTrain
public List<Strategy> getStrategies()
getStrategies
in interface MLTrain
public void iteration()
BasicEA
public void postIteration()
public void preIteration()
Copyright © 2014. All Rights Reserved.