com.rapidminer.operator.meta
Class GridSearchParameterOptimizationOperator

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.GridSearchParameterOptimizationOperator
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler
Direct Known Subclasses:
QuadraticParameterOptimizationOperator

public class GridSearchParameterOptimizationOperator
extends ParameterOptimizationOperator

This operator finds the optimal values for a set of parameters using a grid search. The parameter parameters is a list of key value pairs where the keys are of the form operator_name.parameter_name and the value is either a comma separated list of values (e.g. 10,15,20,25) or an interval definition in the format [start;end;stepsize] (e.g. [10;25;5]). Alternatively a value grid pattern may be used by [e.g. [start;end;no_steps;scale], where scale identifies the type of the pattern.

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. Another parameter optimization schems like the EvolutionaryParameterOptimizationOperator might also be useful if the best ranges and dependencies are not known at all. Another operator which works similar to this parameter optimization operator is the operator ParameterIteration. In contrast to the optimization operator, this operator simply iterates through all parameter combinations. This might be especially useful for plotting purposes.

Author:
Simon Fischer, Helge Homburg, Ingo Mierswa, Tobias Malbrecht 15:35:49 ingomierswa Exp $

Field Summary
protected  int[] currentIndex
           
protected  int numberOfCombinations
           
protected  int numberOfParameters
           
protected  Operator[] operators
           
protected  java.lang.String[] parameters
           
protected  java.lang.String[][] values
           
 
Fields inherited from class com.rapidminer.operator.meta.ParameterIteratingOperatorChain
PARAMETER_PARAMETERS, PARAMETER_VALUES, VALUE_MODE_CONTINUOUS, VALUE_MODE_DISCRETE
 
Constructor Summary
GridSearchParameterOptimizationOperator(OperatorDescription description)
           
 
Method Summary
 IOObject[] apply()
          Applies all inner operators.
 double getCurrentBestPerformance()
           
protected  void getParametersToOptimize()
           
 int getParameterValueMode()
          Has to return one of the predefined modes which indicate whether the operator takes discrete values or intervals as basis for optimization.
 
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, getParameterTypes, 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

operators

protected Operator[] operators

parameters

protected java.lang.String[] parameters

values

protected java.lang.String[][] values

currentIndex

protected int[] currentIndex

numberOfCombinations

protected int numberOfCombinations

numberOfParameters

protected int numberOfParameters
Constructor Detail

GridSearchParameterOptimizationOperator

public GridSearchParameterOptimizationOperator(OperatorDescription description)
Method Detail

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

getParametersToOptimize

protected void getParametersToOptimize()
                                throws OperatorException
Throws:
OperatorException

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


Copyright © 2001-2009 by Rapid-I