com.rapidminer.operator.preprocessing.filter.attributes
Interface AttributeFilterCondition

All Known Implementing Classes:
AbstractAttributeFilterCondition, BlockTypeAttributeFilter, DateAttributeFilter, MissingValuesAttributeFilter, NominalAttributeFilter, NoMissingValuesAttributeFilter, NumericalAttributeFilter, NumericValueAttributeFilter, RegexpAttributeFilter, SingleAttributeFilter, SubsetAttributeFilter, TransparentAttributeFilter, ValueTypeAttributeFilter

public interface AttributeFilterCondition

This interface must be implemented by classes implementing an AttributeFilterCondition for the AttributeFilter operator.

Author:
Sebastian Land, Ingo Mierswa

Nested Class Summary
static class AttributeFilterCondition.ScanResult
           
 
Method Summary
 AttributeFilterCondition.ScanResult beforeScanCheck(Attribute attribute)
          This method initializes this condition and resets all counters.
 AttributeFilterCondition.ScanResult check(Attribute attribute, Example example)
          This method checks the given example.
 AttributeFilterCondition.ScanResult checkAfterFullScan()
          This method has to be invoked after a full scan has been performed if the isNeedingFullScan method returns true.
 java.util.List<ParameterType> getParameterTypes(ParameterHandler operator, InputPort inPort, int... valueTypes)
          This method is used to get parameters needed by this AttributeFilter
 void init(ParameterHandler operator)
          Initializes the condition before checking anything.
 MetaDataInfo isFilteredOutMetaData(AttributeMetaData attribute, ParameterHandler parameterHandler)
          This method tries to check if the given attribute is contained, removed from the resulting operation or if the result is unpredictable.
 boolean isNeedingFullScan()
          Indicates that this filter needs a full data scan and can evaluate its condition only after the full scan has been performed.
 boolean isNeedingScan()
          Indicates if this filter needs a data scan, i.e. an invocation of the check method for each example.
 

Method Detail

init

void init(ParameterHandler operator)
          throws UserError,
                 ConditionCreationException
Initializes the condition before checking anything. If checking depends on parameters, their values might be retrieved in this method.

Throws:
UserError
ConditionCreationException - TODO

isFilteredOutMetaData

MetaDataInfo isFilteredOutMetaData(AttributeMetaData attribute,
                                   ParameterHandler parameterHandler)
                                   throws ConditionCreationException
This method tries to check if the given attribute is contained, removed from the resulting operation or if the result is unpredictable.

Parameters:
attribute - the meta data of the attribute
parameterHandler - to get the value of the defined parameters
Returns:
Throws:
ConditionCreationException

isNeedingScan

boolean isNeedingScan()
Indicates if this filter needs a data scan, i.e. an invocation of the check method for each example.


isNeedingFullScan

boolean isNeedingFullScan()
Indicates that this filter needs a full data scan and can evaluate its condition only after the full scan has been performed. If this method returns true, isNeedingScan must have returned true either.


beforeScanCheck

AttributeFilterCondition.ScanResult beforeScanCheck(Attribute attribute)
                                                    throws UserError
This method initializes this condition and resets all counters. It returns REMOVE, if the attribute can be removed without checking examples. If it has been removed, no checking during examples will occur. If it returns UNCHECKED, this Attribute Filter needs a full check and hence the attribute cannot be deleted or kept. Distinguishing this is important, because of the inverting, which otherwise might remove attributes although they only have been kept for later checking.

Parameters:
attribute - this is the attribute, the filter will have to check for.
Throws:
ConditionCreationException
UserError

check

AttributeFilterCondition.ScanResult check(Attribute attribute,
                                          Example example)
This method checks the given example. During this method the filter might check data to decide if attribute should be filtered out. If the condition needs a full scan before it can decide, this result is ignored.


checkAfterFullScan

AttributeFilterCondition.ScanResult checkAfterFullScan()
This method has to be invoked after a full scan has been performed if the isNeedingFullScan method returns true.

Returns:
This method has to be restricted to return KEEP or REMOVED, but not unchecked

getParameterTypes

java.util.List<ParameterType> getParameterTypes(ParameterHandler operator,
                                                InputPort inPort,
                                                int... valueTypes)
This method is used to get parameters needed by this AttributeFilter

Parameters:
handler - the parameter handler for defining dependencies


Copyright © 2001-2009 by Rapid-I