com.rapidminer.operator.preprocessing.filter.attributes
Class MissingValuesAttributeFilter

java.lang.Object
  extended by com.rapidminer.operator.preprocessing.filter.attributes.AbstractAttributeFilterCondition
      extended by com.rapidminer.operator.preprocessing.filter.attributes.MissingValuesAttributeFilter
All Implemented Interfaces:
AttributeFilterCondition

public class MissingValuesAttributeFilter
extends AbstractAttributeFilterCondition

This condition checks whether an attribute contains less than a specified fraction of missing values. If the maximal fraction is exceeded, the attribute is removed. This condition needs a full data scan per attribute and hence might downspeed calculations.

Author:
Sebastian Land

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.rapidminer.operator.preprocessing.filter.attributes.AttributeFilterCondition
AttributeFilterCondition.ScanResult
 
Field Summary
static java.lang.String PARAMETER_MAX_FRACTION_MISSING
           
 
Constructor Summary
MissingValuesAttributeFilter()
           
 
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(Operator operator)
          Just returns an empty list.
 void init(Operator operator)
          Initializes the condition before checking anything.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_MAX_FRACTION_MISSING

public static final java.lang.String PARAMETER_MAX_FRACTION_MISSING
See Also:
Constant Field Values
Constructor Detail

MissingValuesAttributeFilter

public MissingValuesAttributeFilter()
Method Detail

beforeScanCheck

public AttributeFilterCondition.ScanResult beforeScanCheck(Attribute attribute)
                                                    throws UserError
Description copied from interface: AttributeFilterCondition
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:
UserError

check

public AttributeFilterCondition.ScanResult check(Attribute attribute,
                                                 Example example)
Description copied from interface: AttributeFilterCondition
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.

Specified by:
check in interface AttributeFilterCondition
Overrides:
check in class AbstractAttributeFilterCondition

isNeedingFullScan

public boolean isNeedingFullScan()
Description copied from interface: AttributeFilterCondition
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.

Specified by:
isNeedingFullScan in interface AttributeFilterCondition
Overrides:
isNeedingFullScan in class AbstractAttributeFilterCondition

isNeedingScan

public boolean isNeedingScan()
Description copied from interface: AttributeFilterCondition
Indicates if this filter needs a data scan, i.e. an invocation of the check method for each example.

Specified by:
isNeedingScan in interface AttributeFilterCondition
Overrides:
isNeedingScan in class AbstractAttributeFilterCondition

checkAfterFullScan

public AttributeFilterCondition.ScanResult checkAfterFullScan()
Description copied from interface: AttributeFilterCondition
This method has to be invoked after a full scan has been performed if the isNeedingFullScan method returns true.

Specified by:
checkAfterFullScan in interface AttributeFilterCondition
Overrides:
checkAfterFullScan in class AbstractAttributeFilterCondition
Returns:
This method has to be restricted to return KEEP or REMOVED, but not unchecked

init

public void init(Operator operator)
          throws UserError
Description copied from interface: AttributeFilterCondition
Initializes the condition before checking anything. If checking depends on parameters, their values might be retrieved in this method.

Specified by:
init in interface AttributeFilterCondition
Overrides:
init in class AbstractAttributeFilterCondition
Throws:
UserError

getParameterTypes

public java.util.List<ParameterType> getParameterTypes(Operator operator)
Description copied from class: AbstractAttributeFilterCondition
Just returns an empty list. Subclasses might add parameters

Specified by:
getParameterTypes in interface AttributeFilterCondition
Overrides:
getParameterTypes in class AbstractAttributeFilterCondition


Copyright © 2001-2009 by Rapid-I