com.rapidminer.operator.preprocessing.discretization
Class UserBasedDiscretization

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.discretization.AbstractDiscretizationOperator
                          extended by com.rapidminer.operator.preprocessing.discretization.UserBasedDiscretization
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, ParameterHandler, LoggingHandler, Observable<Operator>

public class UserBasedDiscretization
extends AbstractDiscretizationOperator

This operator discretizes a numerical attribute to either a nominal or an ordinal attribute. The numerical values are mapped to the classes according to the thresholds specified by the user. The user can define the classes by specifying the upper limits of each class. The lower limit of the next class is automatically specified as the upper limit of the previous one. A parameter defines to which adjacent class values that are equal to the given limits should be mapped. If the upper limit in the last list entry is not equal to Infinity, an additional class which is automatically named is added. If a '?' is given as class value the according numerical values are mapped to unknown values in the resulting attribute.

Author:
Sebastian Land

Field Summary
static int ATTRIBUTE_TYPE_NOMINAL
           
static int ATTRIBUTE_TYPE_ORDINAL
           
static java.lang.String[] attributeTypeStrings
           
static java.lang.String PARAMETER_ATTRIBUTE_TYPE
          The parameter name for "Attribute type of the discretized attribute.
static java.lang.String PARAMETER_RANGE_NAMES
          The parameter name for "Defines the classes and the upper limits of each class.
static java.lang.String PARAMETER_UPPER_LIMIT
          The parameter name for the upper limit.
 
Fields inherited from class com.rapidminer.operator.preprocessing.PreprocessingOperator
attributeSelector, PARAMETER_CREATE_VIEW, PARAMETER_RETURN_PREPROCESSING_MODEL
 
Constructor Summary
UserBasedDiscretization(OperatorDescription description)
           
 
Method Summary
 PreprocessingModel createPreprocessingModel(ExampleSet exampleSet)
           
 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.
 
Methods inherited from class com.rapidminer.operator.preprocessing.discretization.AbstractDiscretizationOperator
createDiscretizationFixes, getFilterValueTypes, registerDiscretizationOperator
 
Methods inherited from class com.rapidminer.operator.preprocessing.PreprocessingOperator
apply, checkSelectedSubsetMetaData, doWork, doWorkModel, getPreprocessingModelOutputPort, getSelectedAttributes, isSupportingAttributeRoles, isSupportingView, modifyMetaData, 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
 

Field Detail

PARAMETER_ATTRIBUTE_TYPE

public static final java.lang.String PARAMETER_ATTRIBUTE_TYPE
The parameter name for "Attribute type of the discretized attribute."

See Also:
Constant Field Values

PARAMETER_UPPER_LIMIT

public static final java.lang.String PARAMETER_UPPER_LIMIT
The parameter name for the upper limit.

See Also:
Constant Field Values

PARAMETER_RANGE_NAMES

public static final java.lang.String PARAMETER_RANGE_NAMES
The parameter name for "Defines the classes and the upper limits of each class."

See Also:
Constant Field Values

attributeTypeStrings

public static final java.lang.String[] attributeTypeStrings

ATTRIBUTE_TYPE_NOMINAL

public static final int ATTRIBUTE_TYPE_NOMINAL
See Also:
Constant Field Values

ATTRIBUTE_TYPE_ORDINAL

public static final int ATTRIBUTE_TYPE_ORDINAL
See Also:
Constant Field Values
Constructor Detail

UserBasedDiscretization

public UserBasedDiscretization(OperatorDescription description)
Method Detail

modifyAttributeMetaData

protected java.util.Collection<AttributeMetaData> modifyAttributeMetaData(ExampleSetMetaData emd,
                                                                          AttributeMetaData amd)
                                                                   throws UndefinedParameterError
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.

Overrides:
modifyAttributeMetaData in class AbstractDiscretizationOperator
Throws:
UndefinedParameterError

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

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