com.rapidminer.operator.features.selection
Class GeneticAlgorithm

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.OperatorChain
          extended by com.rapidminer.operator.features.FeatureOperator
              extended by com.rapidminer.operator.features.selection.AbstractGeneticAlgorithm
                  extended by com.rapidminer.operator.features.selection.GeneticAlgorithm
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class GeneticAlgorithm
extends AbstractGeneticAlgorithm

A genetic algorithm for feature selection (mutation=switch features on and off, crossover=interchange used features). Selection is done by roulette wheel. Genetic algorithms are general purpose optimization / search algorithms that are suitable in case of no or little problem knowledge.
A genetic algorithm works as follows

  1. Generate an initial population consisting of population_size individuals. Each attribute is switched on with probability p_initialize
  2. For all individuals in the population
  3. Perform selection, map all individuals to sections on a roulette wheel whose size is proportional to the individual's fitness and draw population_size individuals at random according to their probability.
  4. As long as the fitness improves, go to 2
If the example set contains value series attributes with blocknumbers, the whole block will be switched on and off.

Author:
Ingo Mierswa, Simon Fischer

Field Summary
static java.lang.String PARAMETER_CROSSOVER_TYPE
          The parameter name for "Type of the crossover.
static java.lang.String PARAMETER_EXACT_NUMBER_OF_ATTRIBUTES
           
static java.lang.String PARAMETER_INITIALIZE_WITH_INPUT_WEIGHTS
           
static java.lang.String PARAMETER_MAX_NUMBER_OF_ATTRIBUTES
           
static java.lang.String PARAMETER_MIN_NUMBER_OF_ATTRIBUTES
           
static java.lang.String PARAMETER_P_CROSSOVER
          The parameter name for "Probability for an individual to be selected for crossover.
static java.lang.String PARAMETER_P_INITIALIZE
          The parameter name for "Initial probability for an attribute to be switched on.
static java.lang.String PARAMETER_P_MUTATION
          The parameter name for "Probability for an attribute to be changed (-1: 1 / numberOfAtt).
 
Fields inherited from class com.rapidminer.operator.features.selection.AbstractGeneticAlgorithm
BOLTZMANN_SELECTION, CUT_SELECTION, NON_DOMINATED_SORTING_SELECTION, PARAMETER_DYNAMIC_SELECTION_PRESSURE, PARAMETER_GENERATIONS_WITHOUT_IMPROVAL, PARAMETER_INTERMEDIATE_WEIGHTS_FILE, PARAMETER_INTERMEDIATE_WEIGHTS_GENERATIONS, PARAMETER_KEEP_BEST_INDIVIDUAL, PARAMETER_MAXIMUM_NUMBER_OF_GENERATIONS, PARAMETER_POPULATION_SIZE, PARAMETER_SAVE_INTERMEDIATE_WEIGHTS, PARAMETER_SELECTION_SCHEME, PARAMETER_START_TEMPERATURE, PARAMETER_TOURNAMENT_SIZE, RANK_SELECTION, ROULETTE_WHEEL, SELECTION_SCHEMES, STOCHASTIC_UNIVERSAL, TOURNAMENT_SELECTION, UNIFORM_SELECTION
 
Fields inherited from class com.rapidminer.operator.features.FeatureOperator
PARAMETER_CONSTRAINT_DRAW_RANGE, PARAMETER_DRAW_DOMINATED_POINTS, PARAMETER_LOCAL_RANDOM_SEED, PARAMETER_MAXIMAL_FITNESS, PARAMETER_NORMALIZE_WEIGHTS, PARAMETER_PLOT_GENERATIONS, PARAMETER_POPULATION_CRITERIA_DATA_FILE, PARAMETER_SHOW_POPULATION_PLOTTER, PARAMETER_SHOW_STOP_DIALOG, PARAMETER_USER_RESULT_INDIVIDUAL_SELECTION
 
Constructor Summary
GeneticAlgorithm(OperatorDescription description)
           
 
Method Summary
 Population createInitialPopulation(ExampleSet es)
          Sets up a population of given size and creates ExampleSets with randomly selected attributes (the probability to be switched on is controlled by pInitialize).
protected  PopulationOperator getCrossoverPopulationOperator(ExampleSet eSet)
          Returns an operator that performs crossover.
protected  PopulationOperator getMutationPopulationOperator(ExampleSet eSet)
          Returns an operator that performs the mutation.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 
Methods inherited from class com.rapidminer.operator.features.selection.AbstractGeneticAlgorithm
getPostEvaluationPopulationOperators, getPostProcessingPopulationOperators, getPreEvaluationPopulationOperators, getPreProcessingPopulationOperators, solutionGoodEnough
 
Methods inherited from class com.rapidminer.operator.features.FeatureOperator
apply, createCleanClone, evaluate, getCheckForMaximum, getInnerOperatorCondition, getInputClasses, getMaxNumberOfInnerOperators, getMinNumberOfInnerOperators, getOutputClasses, getPopulation, getPopulationEvaluator, getRandom, setCheckForMaximum
 
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, shouldAddNonConsumedInput, 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_P_INITIALIZE

public static final java.lang.String PARAMETER_P_INITIALIZE
The parameter name for "Initial probability for an attribute to be switched on."

See Also:
Constant Field Values

PARAMETER_P_MUTATION

public static final java.lang.String PARAMETER_P_MUTATION
The parameter name for "Probability for an attribute to be changed (-1: 1 / numberOfAtt)."

See Also:
Constant Field Values

PARAMETER_P_CROSSOVER

public static final java.lang.String PARAMETER_P_CROSSOVER
The parameter name for "Probability for an individual to be selected for crossover."

See Also:
Constant Field Values

PARAMETER_CROSSOVER_TYPE

public static final java.lang.String PARAMETER_CROSSOVER_TYPE
The parameter name for "Type of the crossover."

See Also:
Constant Field Values

PARAMETER_MAX_NUMBER_OF_ATTRIBUTES

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

PARAMETER_MIN_NUMBER_OF_ATTRIBUTES

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

PARAMETER_EXACT_NUMBER_OF_ATTRIBUTES

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

PARAMETER_INITIALIZE_WITH_INPUT_WEIGHTS

public static final java.lang.String PARAMETER_INITIALIZE_WITH_INPUT_WEIGHTS
See Also:
Constant Field Values
Constructor Detail

GeneticAlgorithm

public GeneticAlgorithm(OperatorDescription description)
Method Detail

createInitialPopulation

public Population createInitialPopulation(ExampleSet es)
                                   throws OperatorException
Sets up a population of given size and creates ExampleSets with randomly selected attributes (the probability to be switched on is controlled by pInitialize).

Specified by:
createInitialPopulation in class FeatureOperator
Throws:
OperatorException

getMutationPopulationOperator

protected PopulationOperator getMutationPopulationOperator(ExampleSet eSet)
                                                    throws UndefinedParameterError
Returns an operator that performs the mutation. Can be overridden by subclasses.

Specified by:
getMutationPopulationOperator in class AbstractGeneticAlgorithm
Throws:
UndefinedParameterError

getCrossoverPopulationOperator

protected PopulationOperator getCrossoverPopulationOperator(ExampleSet eSet)
                                                     throws UndefinedParameterError
Returns an operator that performs crossover. Can be overridden by subclasses.

Specified by:
getCrossoverPopulationOperator in class AbstractGeneticAlgorithm
Throws:
UndefinedParameterError

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 AbstractGeneticAlgorithm


Copyright © 2001-2009 by Rapid-I