Package adams.data.cleaner.instance
Class MinMax
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.cleaner.instance.AbstractCleaner
-
- adams.data.cleaner.instance.MinMax
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.ShallowCopySupporter<AbstractCleaner>,adams.core.SizeOfHandler,adams.flow.core.FlowContextHandler,Serializable,Comparable
public class MinMax extends AbstractCleaner
Checks an attribute in the Instance whether the value is within a certain range.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-att-name <java.lang.String> (property: attributeName) The name of the attribute to work on; uses last attribute if left empty. default:
-min <double> (property: minimum) The minimum value the field is allowed to have (inclusive), use -1 to disable. default: -1.0
-max <double> (property: maximum) The maximum value that the field is allowed to have (incl), use -1 to disable. default: -1.0
- Version:
- $Revision: 2242 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_AttributeNamethe attribute name to check, uses last if left empty.protected doublem_Maximumthe maximum value of the attribute.protected doublem_Minimumthe minimum value of the attribute.-
Fields inherited from class adams.data.cleaner.instance.AbstractCleaner
m_ActualPreFilter, m_CleanInstancesError, m_FlowContext, m_PreFilter
-
-
Constructor Summary
Constructors Constructor Description MinMax()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringattributeNameTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringgetAttributeName()Returns the name of the attribute to work on.doublegetMaximum()Returns the maximum value the field is allowed to have (incl).doublegetMinimum()Returns the minimum value the field can have (incl.).StringglobalInfo()Returns a string describing the object.StringmaximumTipText()Returns the tip text for this property.StringminimumTipText()Returns the tip text for this property.protected StringperformCheck(weka.core.Instance data)Performs the actual check.protected weka.core.InstancesperformClean(weka.core.Instances instances)Clean Instances.voidsetAttributeName(String value)Sets the name of the attribute to work on.voidsetMaximum(double value)Sets maximum value the field is allowed to have (incl).voidsetMinimum(double value)Sets the minimum value the field can have (incl.).-
Methods inherited from class adams.data.cleaner.instance.AbstractCleaner
check, clean, compareTo, equals, forCommandLine, forName, getCleaners, getCleanInstancesError, getFlowContext, getPreFilter, hasCleanInstancesError, preCheck, preCheck, preFilter, preFilter, preFilterTipText, reset, setFlowContext, setPreFilter, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_AttributeName
protected String m_AttributeName
the attribute name to check, uses last if left empty.
-
m_Minimum
protected double m_Minimum
the minimum value of the attribute.
-
m_Maximum
protected double m_Maximum
the maximum value of the attribute.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractCleaner
-
setAttributeName
public void setAttributeName(String value)
Sets the name of the attribute to work on.- Parameters:
value- the attribute name
-
getAttributeName
public String getAttributeName()
Returns the name of the attribute to work on.- Returns:
- the attribute name
-
attributeNameTipText
public String attributeNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMinimum
public void setMinimum(double value)
Sets the minimum value the field can have (incl.).- Parameters:
value- the minimum
-
getMinimum
public double getMinimum()
Returns the minimum value the field can have (incl.).- Returns:
- the minimum
-
minimumTipText
public String minimumTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaximum
public void setMaximum(double value)
Sets maximum value the field is allowed to have (incl).- Parameters:
value- the maximum
-
getMaximum
public double getMaximum()
Returns the maximum value the field is allowed to have (incl).- Returns:
- the maximum
-
maximumTipText
public String maximumTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
performCheck
protected String performCheck(weka.core.Instance data)
Performs the actual check.- Specified by:
performCheckin classAbstractCleaner- Parameters:
data- the Instance to check- Returns:
- null if ok, otherwise error message
-
performClean
protected weka.core.Instances performClean(weka.core.Instances instances)
Clean Instances.- Specified by:
performCleanin classAbstractCleaner- Parameters:
instances- Instances- Returns:
- null if ok, otherwise error message
-
-