com.rapidminer.operator.meta
Class EvolutionaryParameterOptimizationOperator

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.OperatorChain
          extended by com.rapidminer.operator.meta.ParameterIteratingOperatorChain
              extended by com.rapidminer.operator.meta.ParameterOptimizationOperator
                  extended by com.rapidminer.operator.meta.EvolutionaryParameterOptimizationOperator
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class EvolutionaryParameterOptimizationOperator
extends ParameterOptimizationOperator

This operator finds the optimal values for a set of parameters using an evolutionary strategies approach which is often more appropriate than a grid search or a greedy search like the quadratic programming approach and leads to better results. The parameter parameters is a list of key value pairs where the keys are of the form operator_name.parameter_name and the value for each parameter must be a semicolon separated pair of a minimum and a maximum value in squared parantheses, e.g. [10;100] for a range of 10 until 100.
The operator returns an optimal ParameterSet which can as well be written to a file with a ParameterSetWriter. This parameter set can be read in another process using a ParameterSetLoader.
The file format of the parameter set file is straightforward and can easily be generated by external applications. Each line is of the form

operator_name.parameter_name = value

Please refer to section Advanced Processes/Parameter and performance analysis for an example application.

Author:
Ingo Mierswa, Tobias Malbrecht

Field Summary
static java.lang.String PARAMETER_CROSSOVER_PROB
          The parameter name for "The probability for crossover.
static java.lang.String PARAMETER_GENERATIONS_WITHOUT_IMPROVAL
          The parameter name for "Stop after this number of generations without improvement (-1: optimize until max_iterations).
static java.lang.String PARAMETER_KEEP_BEST
          The parameter name for "Indicates if the best individual should survive (elititst selection).
static java.lang.String PARAMETER_LOCAL_RANDOM_SEED
          The parameter name for "Use the given random seed instead of global random numbers (-1: use global).
static java.lang.String PARAMETER_MAX_GENERATIONS
          The parameter name for "Stop after this many evaluations"
static java.lang.String PARAMETER_MUTATION_TYPE
          The parameter name for "The type of the mutation operator.
static java.lang.String PARAMETER_POPULATION_SIZE
          The parameter name for "The population size (-1: number of examples)"
static java.lang.String PARAMETER_SELECTION_TYPE
          The parameter name for "The type of the selection operator.
static java.lang.String PARAMETER_SHOW_CONVERGENCE_PLOT
          The parameter name for "Indicates if a dialog with a convergence plot should be drawn.
static java.lang.String PARAMETER_TOURNAMENT_FRACTION
          The parameter name for "The fraction of the population used for tournament selection.
 
Fields inherited from class com.rapidminer.operator.meta.ParameterIteratingOperatorChain
PARAMETER_PARAMETERS, PARAMETER_VALUES, VALUE_MODE_CONTINUOUS, VALUE_MODE_DISCRETE
 
Constructor Summary
EvolutionaryParameterOptimizationOperator(OperatorDescription description)
           
 
Method Summary
 IOObject[] apply()
          Applies all inner operators.
protected  ESOptimization createOptimizer(RandomGenerator random)
          This method creates a apropriate optimizer
 double getCurrentBestPerformance()
           
 int getNumberOfOptimizationParameters()
           
 ESOptimization getOptimization()
           
 IOContainer getOptimizationInput()
           
 Operator[] getOptimizationOperators()
           
 java.lang.String[] getOptimizationParameters()
           
 OptimizationValueType[] getOptimizationValueTypes()
           
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 int getParameterValueMode()
          Has to return one of the predefined modes which indicate whether the operator takes discrete values or intervals as basis for optimization.
 PerformanceVector setParametersAndEvaluate(Individual individual)
           
 
Methods inherited from class com.rapidminer.operator.meta.ParameterOptimizationOperator
getInnerOperatorCondition, getInputClasses, getOutputClasses, getPerformance, getPerformance
 
Methods inherited from class com.rapidminer.operator.meta.ParameterIteratingOperatorChain
getMaxNumberOfInnerOperators, getMinNumberOfInnerOperators, parseParameterValues, shouldAddNonConsumedInput
 
Methods inherited from class com.rapidminer.operator.OperatorChain
addAddListener, addOperator, addOperator, checkDeprecations, checkIO, checkNumberOfInnerOperators, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createProcessTree, getAllInnerOperators, getIndexOfOperator, getInnerOperatorForName, getInnerOperatorsXML, getNumberOfAllOperators, getNumberOfOperators, getOperator, getOperatorFromAll, getOperators, performAdditionalChecks, processFinished, processStarts, registerOperator, removeAddListener, removeOperator, shouldReturnInnerOutput, unregisterOperator
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkForStop, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, register, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_MAX_GENERATIONS

public static final java.lang.String PARAMETER_MAX_GENERATIONS
The parameter name for "Stop after this many evaluations"

See Also:
Constant Field Values

PARAMETER_GENERATIONS_WITHOUT_IMPROVAL

public static final java.lang.String PARAMETER_GENERATIONS_WITHOUT_IMPROVAL
The parameter name for "Stop after this number of generations without improvement (-1: optimize until max_iterations)."

See Also:
Constant Field Values

PARAMETER_POPULATION_SIZE

public static final java.lang.String PARAMETER_POPULATION_SIZE
The parameter name for "The population size (-1: number of examples)"

See Also:
Constant Field Values

PARAMETER_TOURNAMENT_FRACTION

public static final java.lang.String PARAMETER_TOURNAMENT_FRACTION
The parameter name for "The fraction of the population used for tournament selection."

See Also:
Constant Field Values

PARAMETER_KEEP_BEST

public static final java.lang.String PARAMETER_KEEP_BEST
The parameter name for "Indicates if the best individual should survive (elititst selection)."

See Also:
Constant Field Values

PARAMETER_MUTATION_TYPE

public static final java.lang.String PARAMETER_MUTATION_TYPE
The parameter name for "The type of the mutation operator."

See Also:
Constant Field Values

PARAMETER_SELECTION_TYPE

public static final java.lang.String PARAMETER_SELECTION_TYPE
The parameter name for "The type of the selection operator."

See Also:
Constant Field Values

PARAMETER_CROSSOVER_PROB

public static final java.lang.String PARAMETER_CROSSOVER_PROB
The parameter name for "The probability for crossover."

See Also:
Constant Field Values

PARAMETER_LOCAL_RANDOM_SEED

public static final java.lang.String PARAMETER_LOCAL_RANDOM_SEED
The parameter name for "Use the given random seed instead of global random numbers (-1: use global)."

See Also:
Constant Field Values

PARAMETER_SHOW_CONVERGENCE_PLOT

public static final java.lang.String PARAMETER_SHOW_CONVERGENCE_PLOT
The parameter name for "Indicates if a dialog with a convergence plot should be drawn."

See Also:
Constant Field Values
Constructor Detail

EvolutionaryParameterOptimizationOperator

public EvolutionaryParameterOptimizationOperator(OperatorDescription description)
Method Detail

getOptimizationInput

public IOContainer getOptimizationInput()

getOptimizationOperators

public Operator[] getOptimizationOperators()

getOptimizationParameters

public java.lang.String[] getOptimizationParameters()

getOptimizationValueTypes

public OptimizationValueType[] getOptimizationValueTypes()

getParameterValueMode

public int getParameterValueMode()
Description copied from class: ParameterIteratingOperatorChain
Has to return one of the predefined modes which indicate whether the operator takes discrete values or intervals as basis for optimization. The first option is to be taken for all strategies that iterate over the given parameters. The latter option is to be taken for strategies such as an evolutionary one in which allowed ranges of parameters have to be specified.

Specified by:
getParameterValueMode in class ParameterIteratingOperatorChain

getCurrentBestPerformance

public double getCurrentBestPerformance()
Specified by:
getCurrentBestPerformance in class ParameterOptimizationOperator

apply

public IOObject[] apply()
                 throws OperatorException
Description copied from class: OperatorChain
Applies all inner operators. The input to this operator becomes the input of the first inner operator. The latter's output is passed to the second inner operator and so on. Note to subclassers: If subclasses (for example wrappers) want to make use of this method remember to call exactly this method (super.apply()) and do not call super.apply(IOContainer) erroneously which will result in an infinite loop.

Overrides:
apply in class OperatorChain
Returns:
the last inner operator's output or the input itself if the chain is empty.
Throws:
OperatorException

createOptimizer

protected ESOptimization createOptimizer(RandomGenerator random)
                                  throws UndefinedParameterError
This method creates a apropriate optimizer

Throws:
UndefinedParameterError

getOptimization

public ESOptimization getOptimization()

setParametersAndEvaluate

public PerformanceVector setParametersAndEvaluate(Individual individual)
                                           throws OperatorException
Throws:
OperatorException

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class ParameterIteratingOperatorChain

getNumberOfOptimizationParameters

public int getNumberOfOptimizationParameters()


Copyright © 2001-2009 by Rapid-I