com.rapidminer.operator.features.construction
Class ExampleSetBasedFeatureOperator

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.construction.ExampleSetBasedFeatureOperator
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, ParameterHandler, LoggingHandler, Observable<Operator>
Direct Known Subclasses:
AbstractGeneratingGeneticAlgorithm

public abstract class ExampleSetBasedFeatureOperator
extends OperatorChain

This class is the superclass of all feature selection and generation operators. It provides an easy to use plug-in interface for operators that modify populations. Subclasses just have to supply lists of PopulationOperators by overriding getPreEvalutaionPopulationOperators() and getPostEvalutaionPopulationOperators() during a loop which will terminate if solutionGoodEnough() returns true.

Author:
Ingo Mierswa

Field Summary
static java.lang.String PARAMETER_MAXIMAL_FITNESS
           
static java.lang.String PARAMETER_SHOW_STOP_DIALOG
           
 
Constructor Summary
ExampleSetBasedFeatureOperator(OperatorDescription description)
           
 
Method Summary
abstract  ExampleSetBasedPopulation createInitialPopulation(ExampleSet es)
          Create an initial population.
 void doWork()
          Applies the feature operator: collects the pre- and postevaluation operators create an initial population evaluate the initial population loop as long as solution is not good enough apply all pre evaluation operators evaluate the population update the population's best individual apply all post evaluation operators return all generation's best individual
protected  PerformanceVector evaluate(ExampleSetBasedIndividual individual)
          Evaluates the given individual.
protected  void evaluate(ExampleSetBasedPopulation population)
          Evaluates all individuals in the population by applying the inner operators.
protected  boolean getCheckForMaximum()
          Returns if the operator should check if the maximum was reached for the main criterion.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
protected  ExampleSetBasedPopulation getPopulation()
           
abstract  java.util.List<ExampleSetBasedPopulationOperator> getPostEvaluationPopulationOperators(ExampleSet input)
          Must return a list of PopulationOperators.
abstract  java.util.List<ExampleSetBasedPopulationOperator> getPreEvaluationPopulationOperators(ExampleSet input)
          Must return a list of PopulationOperators.
protected  RandomGenerator getRandom()
           
protected  void setCheckForMaximum(boolean checkForMaximalFitness)
          Sets if the operator should check if the maximum was reached for the main criterion.
abstract  boolean solutionGoodEnough(ExampleSetBasedPopulation pop)
          Has to return true if the main loop can be stopped because a solution is considered to be good enough according to some criterion.
 
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_SHOW_STOP_DIALOG

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

PARAMETER_MAXIMAL_FITNESS

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

ExampleSetBasedFeatureOperator

public ExampleSetBasedFeatureOperator(OperatorDescription description)
Method Detail

createInitialPopulation

public abstract ExampleSetBasedPopulation createInitialPopulation(ExampleSet es)
                                                           throws OperatorException
Create an initial population. The example set will be cloned before the method is invoked. This method is invoked after the pre- and post-evaluation population operators were collected.

Throws:
OperatorException

getPreEvaluationPopulationOperators

public abstract java.util.List<ExampleSetBasedPopulationOperator> getPreEvaluationPopulationOperators(ExampleSet input)
                                                                                               throws OperatorException
Must return a list of PopulationOperators. All operators are applied to the population in their order within the list before the population is evaluated. Since this method is invoked only once the list cannot by dynamically changed during runtime.

Throws:
OperatorException

getPostEvaluationPopulationOperators

public abstract java.util.List<ExampleSetBasedPopulationOperator> getPostEvaluationPopulationOperators(ExampleSet input)
                                                                                                throws OperatorException
Must return a list of PopulationOperators. All operators are applied to the population in their order within the list after the population is evaluated. Since this method is invoked only once the list cannot by dynamically changed during runtime.

Throws:
OperatorException

solutionGoodEnough

public abstract boolean solutionGoodEnough(ExampleSetBasedPopulation pop)
                                    throws OperatorException
Has to return true if the main loop can be stopped because a solution is considered to be good enough according to some criterion.

Throws:
OperatorException

getRandom

protected RandomGenerator getRandom()

getPopulation

protected ExampleSetBasedPopulation getPopulation()

doWork

public void doWork()
            throws OperatorException
Applies the feature operator:
  1. collects the pre- and postevaluation operators
  2. create an initial population
  3. evaluate the initial population
  4. loop as long as solution is not good enough
    1. apply all pre evaluation operators
    2. evaluate the population
    3. update the population's best individual
    4. apply all post evaluation operators
  5. return all generation's best individual

Overrides:
doWork in class OperatorChain
Throws:
OperatorException

evaluate

protected void evaluate(ExampleSetBasedPopulation population)
                 throws OperatorException
Evaluates all individuals in the population by applying the inner operators.

Throws:
OperatorException

evaluate

protected PerformanceVector evaluate(ExampleSetBasedIndividual individual)
                              throws OperatorException
Evaluates the given individual. The performance is set as user data of the individual and also returned by this method.

Throws:
OperatorException

setCheckForMaximum

protected void setCheckForMaximum(boolean checkForMaximalFitness)
Sets if the operator should check if the maximum was reached for the main criterion. Subclasses may want to set this to false, e.g. for multiobjective optimization.


getCheckForMaximum

protected boolean getCheckForMaximum()
Returns if the operator should check if the maximum was reached for the main criterion. Subclasses may want to set this to false, e.g. for multiobjective optimization.


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 Operator


Copyright © 2001-2009 by Rapid-I