com.rapidminer.operator.preprocessing.filter
Class ExampleFilter

java.lang.Object
  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.filter.ExampleFilter
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class ExampleFilter
extends AbstractDataProcessing

This operator takes an ExampleSet as input and returns a new ExampleSet including only the Examples that fulfill a condition.

By specifying an implementation of Condition and a parameter string, arbitrary filters can be applied. Users can implement their own conditions by writing a subclass of the above class and implementing a two argument constructor taking an ExampleSet and a parameter string. This parameter string is specified by the parameter parameter_string. Instead of using one of the predefined conditions users can define their own implementation with the fully qualified class name.

For "attribute_value_condition" the parameter string must have the form attribute op value, where attribute is a name of an attribute, value is a value the attribute can take and op is one of the binary logical operators similar to the ones known from Java, e.g. greater than or equals. Unknown values are specified with a question mark (for example "att1 = ?").
Please note that you can define a logical OR of several conditions with || and a logical AND of two conditions with two ampersand - or simply by applying several ExampleFilter operators in a row. Please note also that for nominal attributes you can define a regular expression for value of the possible equal and not equal checks. Since that you will have to escape the question mark for specifying unknown values: "att1 = \?" if att1 is nominal.

For "unknown_attributes" the parameter string must be empty. This filter removes all examples containing attributes that have missing or illegal values. For "unknown_label" the parameter string must also be empty. This filter removes all examples with an unknown label value.

Author:
Ingo Mierswa, Simon Fischer

Field Summary
static java.lang.String PARAMETER_CONDITION_CLASS
          The parameter name for "Implementation of the condition.
static java.lang.String PARAMETER_INVERT_FILTER
          The parameter name for "Indicates if only examples should be accepted which would normally filtered.
static java.lang.String PARAMETER_PARAMETER_STRING
          The parameter name for "Parameter string for the condition, e.g.
 
Constructor Summary
ExampleFilter(OperatorDescription description)
           
 
Method Summary
 ExampleSet apply(ExampleSet inputSet)
          Delegate for the apply method.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 
Methods inherited from class com.rapidminer.operator.AbstractExampleSetProcessing
apply, getInputClasses, getOutputClasses
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, 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, performAdditionalChecks, processFinished, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_CONDITION_CLASS

public static final java.lang.String PARAMETER_CONDITION_CLASS
The parameter name for "Implementation of the condition."

See Also:
Constant Field Values

PARAMETER_PARAMETER_STRING

public static final java.lang.String PARAMETER_PARAMETER_STRING
The parameter name for "Parameter string for the condition, e.g. 'attribute=value' for the AttributeValueFilter."

See Also:
Constant Field Values

PARAMETER_INVERT_FILTER

public static final java.lang.String PARAMETER_INVERT_FILTER
The parameter name for "Indicates if only examples should be accepted which would normally filtered."

See Also:
Constant Field Values
Constructor Detail

ExampleFilter

public ExampleFilter(OperatorDescription description)
Method Detail

apply

public ExampleSet apply(ExampleSet inputSet)
                 throws OperatorException
Description copied from class: AbstractExampleSetProcessing
Delegate for the apply method. In most cases, the returned example set will be the same as the example set or a modified clone.

Specified by:
apply in class AbstractExampleSetProcessing
Throws:
OperatorException

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.

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


Copyright © 2001-2009 by Rapid-I