com.rapidminer.operator.features.selection
Class GeneticAlgorithm

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      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, ResourceConsumer, ParameterHandler, LoggingHandler, Observable<Operator>

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).
static java.lang.String PARAMETER_RESTRICT_NUMBER
           
static java.lang.String PARAMETER_USE_EXACT_NUMBER
           
 
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, PARAMETER_USE_EARLY_STOPPING, 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_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.
protected  ExampleSetMetaData modifyInnerOutputExampleSet(ExampleSetMetaData metaData)
          Subclasses might override this method in order to change the meta data delivered to the inner operators.
protected  ExampleSetMetaData modifyOutputExampleSet(ExampleSetMetaData metaData)
          Subclasses might override this method in order to change the final outputed meta data
 
Methods inherited from class com.rapidminer.operator.features.selection.AbstractGeneticAlgorithm
getPostEvaluationPopulationOperators, getPostProcessingPopulationOperators, getPreEvaluationPopulationOperators, getPreProcessingPopulationOperators, solutionGoodEnough
 
Methods inherited from class com.rapidminer.operator.features.FeatureOperator
createCleanClone, doWork, executeEvaluationProcess, getCheckForMaximum, getExampleSetInput, getPopulation, getPopulationEvaluator, getRandom, runEvaluationProcess, setCheckForMaximum
 
Methods inherited from class com.rapidminer.operator.OperatorChain
addOperator, addOperator, addSubprocess, areSubprocessesExtendable, assumePreconditionsSatisfied, checkDeprecations, checkIO, checkNumberOfInnerOperators, checkProperties, clear, cloneOperator, collectErrors, createProcessTree, createSubprocess, freeMemory, getAllInnerOperators, getAllInnerOperatorsAndMe, getImmediateChildren, getIndexOfOperator, getInnerOperatorCondition, getMaxNumberOfInnerOperators, getMinNumberOfInnerOperators, getNumberOfAllOperators, getNumberOfOperators, getNumberOfSubprocesses, getOperator, getOperatorFromAll, getOperators, getSubprocess, getSubprocesses, isEnabled, lookupOperator, notifyRenaming, performAdditionalChecks, processFinished, processStarts, propagateDirtyness, registerOperator, removeOperator, removeSubprocess, shouldAddNonConsumedInput, shouldReturnInnerOutput, unregisterOperator, updateExecutionOrder, walk
 
Methods inherited from class com.rapidminer.operator.Operator
acceptsInput, addError, addError, addValue, addWarning, apply, apply, checkAll, checkAllExcludingMetaData, checkForStop, clearErrorList, createExperimentTree, createExperimentTree, createFromXML, createFromXML, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, disconnectPorts, execute, fireUpdate, getAddOnlyAdditionalOutput, getApplyCount, getCompatibilityLevel, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getDOMRepresentation, getEncoding, getErrorList, getExecutionUnit, getExperiment, getIncompatibleVersionChanges, getInput, getInput, getInput, getInputClasses, getInputDescription, getInputPorts, getIODescription, getLog, getLogger, getName, getNumberOfBreakpoints, getOperatorClassName, getOperatorDescription, getOutputClasses, getOutputPorts, getParameter, getParameterAsBoolean, getParameterAsChar, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsRepositoryLocation, getParameterAsString, getParameterHandler, getParameterList, getParameters, getParameterTupel, getParameterType, getParent, getPortOwner, getProcess, getResourceConsumptionEstimator, getRoot, getStartTime, getTransformer, getUserDescription, getValue, getValues, getXML, getXML, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isDirty, isExpanded, isParallel, isParameterSet, isRunning, log, log, logError, logNote, logWarning, makeDirty, makeDirtyOnUpdate, preAutoWire, producesOutput, register, remove, removeAndKeepConnections, rename, resume, setBreakpoint, setCompatibilityLevel, setEnabled, setEnclosingProcess, setExpanded, setInput, setListParameter, setPairParameter, setParameter, setParameters, setUserDescription, shouldAutoConnect, shouldAutoConnect, shouldStopStandaloneExecution, toString, transformMetaData, writeXML, writeXML
 
Methods inherited from class com.rapidminer.tools.AbstractObservable
addObserver, addObserverAsFirst, fireUpdate, removeObserver
 
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

PARAMETER_USE_EXACT_NUMBER

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

PARAMETER_RESTRICT_NUMBER

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

GeneticAlgorithm

public GeneticAlgorithm(OperatorDescription description)
Method Detail

modifyInnerOutputExampleSet

protected ExampleSetMetaData modifyInnerOutputExampleSet(ExampleSetMetaData metaData)
Description copied from class: FeatureOperator
Subclasses might override this method in order to change the meta data delivered to the inner operators.

Overrides:
modifyInnerOutputExampleSet in class FeatureOperator

modifyOutputExampleSet

protected ExampleSetMetaData modifyOutputExampleSet(ExampleSetMetaData metaData)
Description copied from class: FeatureOperator
Subclasses might override this method in order to change the final outputed meta data

Overrides:
modifyOutputExampleSet in class FeatureOperator

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. ATTENTION! This will create new parameterTypes. For calling already existing parameter types use getParameters().getParameterTypes();

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


Copyright © 2001-2009 by Rapid-I