com.rapidminer.tools.math.optimization.ec.es
Class ESOptimization

java.lang.Object
  extended by com.rapidminer.tools.math.optimization.ec.es.ESOptimization
All Implemented Interfaces:
Optimization
Direct Known Subclasses:
ClassificationEvoOptimization, ESParameterOptimization, KernelLogisticRegressionOptimization, LogisticRegressionOptimization, RegressionEvoOptimization

public abstract class ESOptimization
extends java.lang.Object
implements Optimization

Evolutionary Strategy approach for all real-valued optimization tasks.

Author:
Ingo Mierswa

Field Summary
static int BOLTZMANN_SELECTION
          Indicates a Boltzmann selection scheme.
static int CUT_SELECTION
          Indicates a cut selection scheme.
static int GAUSSIAN_MUTATION
          Indicates a gaussian mutation.
static int INIT_TYPE_MAX
          Indicates that the start population should be initialized with the maximum value.
static int INIT_TYPE_MIN
          Indicates that the start population should be initialized with the minimum value.
static int INIT_TYPE_ONE
          Indicates that the start population should be initialized with one.
static int INIT_TYPE_RANDOM
          Indicates that the start population should be randomly initialized.
static int INIT_TYPE_ZERO
          Indicates that the start population should be initialized with zero.
static java.lang.String[] MUTATION_TYPES
          The names of the mutation types.
static int NO_MUTATION
          Indicates no mutation.
static int NON_DOMINATED_SORTING_SELECTION
          Indicates a multi-objective selection scheme (NSGA II).
static java.lang.String PARAMETER_CROSSOVER_PROB
           
static java.lang.String PARAMETER_GENERATIONS_WITHOUT_IMPROVAL
           
static java.lang.String PARAMETER_KEEP_BEST
           
static java.lang.String PARAMETER_MAX_GENERATIONS
           
static java.lang.String PARAMETER_MUTATION_TYPE
           
static java.lang.String PARAMETER_POPULATION_SIZE
           
static java.lang.String PARAMETER_SELECTION_TYPE
           
static java.lang.String PARAMETER_SHOW_CONVERGENCE_PLOT
           
static java.lang.String PARAMETER_SPECIFIY_POPULATION_SIZE
           
static java.lang.String PARAMETER_TOURNAMENT_FRACTION
           
static java.lang.String PARAMETER_USE_EARLY_STOPPING
           
static java.lang.String[] POPULATION_INIT_TYPES
          The names of the initialization types.
static int RANK_SELECTION
          Indicates a rank based selection scheme.
static int ROULETTE_WHEEL
          Indicates a roulette wheel selection scheme.
static java.lang.String[] SELECTION_TYPES
          The names of all available selection schemes.
static int SPARSITY_MUTATION
          Indicates a hybrid between switching mutation and Gaussian mutation.
static int STOCHASTIC_UNIVERSAL
          Indicates a stochastic universal sampling selection scheme.
static int SWITCHING_MUTATION
          Indicates a switching mutation.
static int TOURNAMENT_SELECTION
          Indicates a tournament selection scheme.
static int UNIFORM_SELECTION
          Indicates a uniform sampling selection scheme.
 
Constructor Summary
ESOptimization(double[] minValues, double[] maxValues, int populationSize, int individualSize, int initType, int maxGenerations, int generationsWithoutImprovement, int selectionType, double tournamentFraction, boolean keepBest, int mutationType, double defaultSigma, double crossoverProb, boolean showConvergencePlot, boolean showPopulationPlot, RandomGenerator random, LoggingHandler logging)
          Creates a new evolutionary SVM optimization.
ESOptimization(double minValue, double maxValue, int populationSize, int individualSize, int initType, int maxGenerations, int generationsWithoutImprovement, int selectionType, double tournamentFraction, boolean keepBest, int mutationType, double crossoverProb, boolean showConvergencePlot, boolean showPopulationPlot, RandomGenerator random, LoggingHandler logging)
          Creates a new evolutionary SVM optimization.
 
Method Summary
protected  void evaluate(Individual current, Population population)
           
protected  void evaluate(Population population)
          Evaluates the individuals of the given population.
protected  void evaluateAll(Population population)
           
abstract  PerformanceVector evaluateIndividual(Individual individual)
          Subclasses must implement this method to calculate the fitness of the given individual.
 double getBestFitnessEver()
          Returns the best fitness ever.
 double getBestFitnessInGeneration()
          Returns the best fitness in the current generation.
 PerformanceVector getBestPerformanceEver()
          Returns the best performance vector ever.
 double[] getBestValuesEver()
          Returns the best values ever.
 int getGeneration()
          Returns the current generation.
 double getMax(int index)
           
 double getMin(int index)
           
static java.util.List<ParameterType> getParameterTypes(Operator parameterHandler)
           
 Population getPopulation()
           
 OptimizationValueType getValueType(int index)
           
 void increaseCurrentEvaluationCounter()
          Getter and setter for subclasses
 void increaseTotalEvaluationCounter()
           
 void nextIteration()
          This method is invoked after each evaluation.
 void optimize()
          Starts the optimization.
 void setMax(int index, double v)
           
 void setMin(int index, double v)
           
 void setValueType(int index, OptimizationValueType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_MAX_GENERATIONS

public static final java.lang.String PARAMETER_MAX_GENERATIONS
See Also:
Constant Field Values

PARAMETER_USE_EARLY_STOPPING

public static final java.lang.String PARAMETER_USE_EARLY_STOPPING
See Also:
Constant Field Values

PARAMETER_GENERATIONS_WITHOUT_IMPROVAL

public static final java.lang.String PARAMETER_GENERATIONS_WITHOUT_IMPROVAL
See Also:
Constant Field Values

PARAMETER_POPULATION_SIZE

public static final java.lang.String PARAMETER_POPULATION_SIZE
See Also:
Constant Field Values

PARAMETER_TOURNAMENT_FRACTION

public static final java.lang.String PARAMETER_TOURNAMENT_FRACTION
See Also:
Constant Field Values

PARAMETER_KEEP_BEST

public static final java.lang.String PARAMETER_KEEP_BEST
See Also:
Constant Field Values

PARAMETER_MUTATION_TYPE

public static final java.lang.String PARAMETER_MUTATION_TYPE
See Also:
Constant Field Values

PARAMETER_SELECTION_TYPE

public static final java.lang.String PARAMETER_SELECTION_TYPE
See Also:
Constant Field Values

PARAMETER_CROSSOVER_PROB

public static final java.lang.String PARAMETER_CROSSOVER_PROB
See Also:
Constant Field Values

PARAMETER_SHOW_CONVERGENCE_PLOT

public static final java.lang.String PARAMETER_SHOW_CONVERGENCE_PLOT
See Also:
Constant Field Values

PARAMETER_SPECIFIY_POPULATION_SIZE

public static final java.lang.String PARAMETER_SPECIFIY_POPULATION_SIZE
See Also:
Constant Field Values

SELECTION_TYPES

public static final java.lang.String[] SELECTION_TYPES
The names of all available selection schemes.


UNIFORM_SELECTION

public static final int UNIFORM_SELECTION
Indicates a uniform sampling selection scheme.

See Also:
Constant Field Values

CUT_SELECTION

public static final int CUT_SELECTION
Indicates a cut selection scheme.

See Also:
Constant Field Values

ROULETTE_WHEEL

public static final int ROULETTE_WHEEL
Indicates a roulette wheel selection scheme.

See Also:
Constant Field Values

STOCHASTIC_UNIVERSAL

public static final int STOCHASTIC_UNIVERSAL
Indicates a stochastic universal sampling selection scheme.

See Also:
Constant Field Values

BOLTZMANN_SELECTION

public static final int BOLTZMANN_SELECTION
Indicates a Boltzmann selection scheme.

See Also:
Constant Field Values

RANK_SELECTION

public static final int RANK_SELECTION
Indicates a rank based selection scheme.

See Also:
Constant Field Values

TOURNAMENT_SELECTION

public static final int TOURNAMENT_SELECTION
Indicates a tournament selection scheme.

See Also:
Constant Field Values

NON_DOMINATED_SORTING_SELECTION

public static final int NON_DOMINATED_SORTING_SELECTION
Indicates a multi-objective selection scheme (NSGA II).

See Also:
Constant Field Values

MUTATION_TYPES

public static final java.lang.String[] MUTATION_TYPES
The names of the mutation types.


NO_MUTATION

public static final int NO_MUTATION
Indicates no mutation.

See Also:
Constant Field Values

GAUSSIAN_MUTATION

public static final int GAUSSIAN_MUTATION
Indicates a gaussian mutation.

See Also:
Constant Field Values

SWITCHING_MUTATION

public static final int SWITCHING_MUTATION
Indicates a switching mutation.

See Also:
Constant Field Values

SPARSITY_MUTATION

public static final int SPARSITY_MUTATION
Indicates a hybrid between switching mutation and Gaussian mutation.

See Also:
Constant Field Values

POPULATION_INIT_TYPES

public static final java.lang.String[] POPULATION_INIT_TYPES
The names of the initialization types.


INIT_TYPE_RANDOM

public static final int INIT_TYPE_RANDOM
Indicates that the start population should be randomly initialized.

See Also:
Constant Field Values

INIT_TYPE_MIN

public static final int INIT_TYPE_MIN
Indicates that the start population should be initialized with the minimum value.

See Also:
Constant Field Values

INIT_TYPE_MAX

public static final int INIT_TYPE_MAX
Indicates that the start population should be initialized with the maximum value.

See Also:
Constant Field Values

INIT_TYPE_ONE

public static final int INIT_TYPE_ONE
Indicates that the start population should be initialized with one.

See Also:
Constant Field Values

INIT_TYPE_ZERO

public static final int INIT_TYPE_ZERO
Indicates that the start population should be initialized with zero.

See Also:
Constant Field Values
Constructor Detail

ESOptimization

public ESOptimization(double minValue,
                      double maxValue,
                      int populationSize,
                      int individualSize,
                      int initType,
                      int maxGenerations,
                      int generationsWithoutImprovement,
                      int selectionType,
                      double tournamentFraction,
                      boolean keepBest,
                      int mutationType,
                      double crossoverProb,
                      boolean showConvergencePlot,
                      boolean showPopulationPlot,
                      RandomGenerator random,
                      LoggingHandler logging)
Creates a new evolutionary SVM optimization.


ESOptimization

public ESOptimization(double[] minValues,
                      double[] maxValues,
                      int populationSize,
                      int individualSize,
                      int initType,
                      int maxGenerations,
                      int generationsWithoutImprovement,
                      int selectionType,
                      double tournamentFraction,
                      boolean keepBest,
                      int mutationType,
                      double defaultSigma,
                      double crossoverProb,
                      boolean showConvergencePlot,
                      boolean showPopulationPlot,
                      RandomGenerator random,
                      LoggingHandler logging)
Creates a new evolutionary SVM optimization.

Method Detail

evaluateIndividual

public abstract PerformanceVector evaluateIndividual(Individual individual)
                                              throws OperatorException
Subclasses must implement this method to calculate the fitness of the given individual. Please note that null might be returned for non-valid individuals. The fitness will be maximized.

Throws:
OperatorException

nextIteration

public void nextIteration()
                   throws OperatorException
This method is invoked after each evaluation. The default implementation does nothing but subclasses might implement this method to support online plotting or logging.

Throws:
OperatorException

getMin

public double getMin(int index)

getMax

public double getMax(int index)

setMin

public void setMin(int index,
                   double v)

setMax

public void setMax(int index,
                   double v)

getValueType

public OptimizationValueType getValueType(int index)

setValueType

public void setValueType(int index,
                         OptimizationValueType type)

optimize

public void optimize()
              throws OperatorException
Starts the optimization.

Specified by:
optimize in interface Optimization
Throws:
OperatorException

evaluate

protected void evaluate(Population population)
                 throws OperatorException
Evaluates the individuals of the given population.

Throws:
OperatorException

evaluateAll

protected void evaluateAll(Population population)
                    throws OperatorException
Throws:
OperatorException

evaluate

protected void evaluate(Individual current,
                        Population population)
                 throws OperatorException
Throws:
OperatorException

getGeneration

public int getGeneration()
Returns the current generation.

Specified by:
getGeneration in interface Optimization

getBestFitnessInGeneration

public double getBestFitnessInGeneration()
Returns the best fitness in the current generation.

Specified by:
getBestFitnessInGeneration in interface Optimization

getBestFitnessEver

public double getBestFitnessEver()
Returns the best fitness ever.

Specified by:
getBestFitnessEver in interface Optimization

getBestPerformanceEver

public PerformanceVector getBestPerformanceEver()
Returns the best performance vector ever.

Specified by:
getBestPerformanceEver in interface Optimization

getPopulation

public Population getPopulation()

getBestValuesEver

public double[] getBestValuesEver()
Returns the best values ever. Use this method after optimization to get the best result. Might returns null if the optimization did not work.

Specified by:
getBestValuesEver in interface Optimization

increaseCurrentEvaluationCounter

public void increaseCurrentEvaluationCounter()
Getter and setter for subclasses


increaseTotalEvaluationCounter

public void increaseTotalEvaluationCounter()

getParameterTypes

public static final java.util.List<ParameterType> getParameterTypes(Operator parameterHandler)


Copyright © 2001-2009 by Rapid-I