geneticWedge.gp
Class StagnationStoppingCriterion

java.lang.Object
  extended by geneticWedge.gp.StoppingCriterion
      extended by geneticWedge.gp.EvaluativeStoppingCriterion
          extended by geneticWedge.gp.StagnationStoppingCriterion

public class StagnationStoppingCriterion
extends EvaluativeStoppingCriterion

StagnationStoppingCriterion stops evolution if no improvement in some measure of Fitness has occurred for some time. The 'patience' of the stopping method (the allowed number of generations without improvement) may be set, as may the value against which to assess improvement: training or validation error; best or averaged value. Note: if both useValidationData and useTrainingData are true, the average of the training and validation fitnesses will be used. If both useValidationData and useTrainingData are false, the training fitness will be used.


Constructor Summary
StagnationStoppingCriterion(int patienceParameter, boolean averageValues, boolean useValidationData)
          StagnationStoppingCriterion constructor.
StagnationStoppingCriterion(int patienceParameter, boolean averageValues, boolean useTrainingData, boolean useValidationData)
          StagnationStoppingCriterion constructor.
 
Method Summary
 boolean lastGenerationWasImproved()
          Returns true if there was an improvment in evaluation function during creation of the last generation.
 boolean stopReached(AbstractPopulation pop)
          Returns true if the stopping condition has been reached (no improvement in evaluation function for a fixed number of generations).
 java.lang.String toString()
          Returns a String representation of this StagnationStoppingCriterion.
 
Methods inherited from class geneticWedge.gp.EvaluativeStoppingCriterion
setMaximise, usesValidation
 
Methods inherited from class geneticWedge.gp.StoppingCriterion
stopIfNoDiversity, stopIfNoDiversity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StagnationStoppingCriterion

public StagnationStoppingCriterion(int patienceParameter,
                                   boolean averageValues,
                                   boolean useValidationData)
StagnationStoppingCriterion constructor.

Parameters:
patienceParameter - The number of generations that are allowed without any improvement. If set to 0, evolution will stop as soon as there is no improvement. Otherwise, the Population will be restored to its state at the optimum value after evolution has been stopped.
averageValues - If true, improvement in average fitness will be used as a stopping criterion, otherwise improvement in best value will be used.
useValidationData - If true, improvement will be assessed against fitnesses on the validation data, otherwise against fitnesses on the training data.

StagnationStoppingCriterion

public StagnationStoppingCriterion(int patienceParameter,
                                   boolean averageValues,
                                   boolean useTrainingData,
                                   boolean useValidationData)
StagnationStoppingCriterion constructor.

Parameters:
patienceParameter - The number of generations that are allowed without any improvement. If set to 0, evolution will stop as soon as there is no improvement. Otherwise, the Population will be restored to its state at the optimum value after evolution has been stopped.
averageValues - If true, improvement in average fitness will be used as a stopping criterion, otherwise improvement in best value will be used.
useValidationData - If true, improvement will be assessed against fitnesses on the validation data. Note: if both useValidationData and useTrainingData are true, the average of the training and validation fitnesses will be used.
useTrainingData - If true, improvement will be assessed against fitnesses on the training data. Note: if both useValidationData and useTrainingData are true, the average of the training and validation fitnesses will be used.
Method Detail

stopReached

public boolean stopReached(AbstractPopulation pop)
Returns true if the stopping condition has been reached (no improvement in evaluation function for a fixed number of generations).

Specified by:
stopReached in class StoppingCriterion

toString

public java.lang.String toString()
Returns a String representation of this StagnationStoppingCriterion. Useful for reporting results.

Specified by:
toString in class StoppingCriterion

lastGenerationWasImproved

public boolean lastGenerationWasImproved()
Returns true if there was an improvment in evaluation function during creation of the last generation.