com.rapidminer.operator.preprocessing.filter
Class ExampleSetToDictionary

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      extended by com.rapidminer.operator.Operator
          extended by com.rapidminer.operator.AbstractExampleSetProcessing
              extended by com.rapidminer.operator.preprocessing.AbstractDataProcessing
                  extended by com.rapidminer.operator.preprocessing.PreprocessingOperator
                      extended by com.rapidminer.operator.preprocessing.filter.ExampleSetToDictionary
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, ParameterHandler, LoggingHandler, Observable<Operator>

public class ExampleSetToDictionary
extends PreprocessingOperator

This operator takes two example sets and transforms the second into a dictionary. The second example set must contain two nominal attributes. For every example in this set a dictionary entry is created matching the first attribute value to the second. Finally, this dictionary is used to replace substrings in the first example set to replacements.

Author:
Simon Fischer

Field Summary
 
Fields inherited from class com.rapidminer.operator.preprocessing.PreprocessingOperator
attributeSelector, PARAMETER_CREATE_VIEW, PARAMETER_RETURN_PREPROCESSING_MODEL
 
Constructor Summary
ExampleSetToDictionary(OperatorDescription description)
           
 
Method Summary
 PreprocessingModel createPreprocessingModel(ExampleSet exampleSet)
           
protected  int[] getFilterValueTypes()
          Defines the value types of the attributes which are processed or affected by this operator.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 java.lang.Class<? extends PreprocessingModel> getPreprocessingModelClass()
           
 ResourceConsumptionEstimator getResourceConsumptionEstimator()
          Subclasses can override this method if they are able to estimate the consumed resources (CPU time and memory), based on their input.
protected  java.util.Collection<AttributeMetaData> modifyAttributeMetaData(ExampleSetMetaData emd, AttributeMetaData amd)
          If this preprocessing operator generates new attributes, the corresponding meta data should be returned by this method.
protected  ExampleSetMetaData modifyMetaData(ExampleSetMetaData exampleSetMetaData)
          Subclasses might override this method to define the meta data transformation performed by this operator.
 
Methods inherited from class com.rapidminer.operator.preprocessing.PreprocessingOperator
apply, checkSelectedSubsetMetaData, doWork, doWorkModel, getSelectedAttributes, isSupportingAttributeRoles, isSupportingView, shouldAutoConnect, writesIntoExistingData
 
Methods inherited from class com.rapidminer.operator.AbstractExampleSetProcessing
doWork, getExampleSetInputPort, getExampleSetOutputPort, getInputPort, getRequiredMetaData
 
Methods inherited from class com.rapidminer.operator.Operator
acceptsInput, addError, addError, addValue, addWarning, apply, apply, assumePreconditionsSatisfied, checkAll, checkAllExcludingMetaData, checkDeprecations, checkForStop, checkIO, checkProperties, clear, clearErrorList, cloneOperator, collectErrors, createExperimentTree, createExperimentTree, createFromXML, createFromXML, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, disconnectPorts, execute, fireUpdate, freeMemory, 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, getRoot, getStartTime, getTransformer, getUserDescription, getValue, getValues, getXML, getXML, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isDirty, isEnabled, isExpanded, isParallel, isParameterSet, isRunning, log, log, logError, logNote, logWarning, lookupOperator, makeDirty, makeDirtyOnUpdate, notifyRenaming, performAdditionalChecks, preAutoWire, processFinished, processStarts, producesOutput, propagateDirtyness, register, registerOperator, remove, removeAndKeepConnections, rename, resume, setBreakpoint, setCompatibilityLevel, setEnabled, setEnclosingProcess, setExpanded, setInput, setListParameter, setPairParameter, setParameter, setParameters, setUserDescription, shouldAutoConnect, shouldStopStandaloneExecution, toString, transformMetaData, unregisterOperator, updateExecutionOrder, walk, 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
 

Constructor Detail

ExampleSetToDictionary

public ExampleSetToDictionary(OperatorDescription description)
Method Detail

modifyMetaData

protected ExampleSetMetaData modifyMetaData(ExampleSetMetaData exampleSetMetaData)
                                     throws UndefinedParameterError
Description copied from class: PreprocessingOperator
Subclasses might override this method to define the meta data transformation performed by this operator. The default implementation takes all attributes specified by the AttributeSubsetSelector and passes them to PreprocessingOperator.modifyAttributeMetaData(ExampleSetMetaData, AttributeMetaData) and replaces them accordingly.

Overrides:
modifyMetaData in class PreprocessingOperator
Throws:
UndefinedParameterError

modifyAttributeMetaData

protected java.util.Collection<AttributeMetaData> modifyAttributeMetaData(ExampleSetMetaData emd,
                                                                          AttributeMetaData amd)
Description copied from class: PreprocessingOperator
If this preprocessing operator generates new attributes, the corresponding meta data should be returned by this method. The attribute will be replaced by the collection. If this operator modifies a single one, amd itself should be modified as a side effect and null should be returned. Note: If an empty collection is returned, amd will be removed, but no new attribute will be added.

Specified by:
modifyAttributeMetaData in class PreprocessingOperator
Parameters:
emd - TODO

createPreprocessingModel

public PreprocessingModel createPreprocessingModel(ExampleSet exampleSet)
                                            throws OperatorException
Specified by:
createPreprocessingModel in class PreprocessingOperator
Throws:
OperatorException

getPreprocessingModelClass

public java.lang.Class<? extends PreprocessingModel> getPreprocessingModelClass()
Specified by:
getPreprocessingModelClass in class PreprocessingOperator

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 PreprocessingOperator

getFilterValueTypes

protected int[] getFilterValueTypes()
Description copied from class: PreprocessingOperator
Defines the value types of the attributes which are processed or affected by this operator. Has to be overridden to restrict the attributes which can be chosen by an AttributeSubsetSelector.

Specified by:
getFilterValueTypes in class PreprocessingOperator
Returns:
array of value types

getResourceConsumptionEstimator

public ResourceConsumptionEstimator getResourceConsumptionEstimator()
Description copied from class: Operator
Subclasses can override this method if they are able to estimate the consumed resources (CPU time and memory), based on their input. The default implementation returns null.

Specified by:
getResourceConsumptionEstimator in interface ResourceConsumer
Overrides:
getResourceConsumptionEstimator in class Operator


Copyright © 2001-2009 by Rapid-I