Package adams.data.spreadsheet.filter
Class Normalize
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,SpreadSheetFilter,TrainableSpreadSheetFilter,Serializable
public class Normalize extends AbstractTrainableSpreadSheetFilter
Normalizes numeric columns to the specified lower and upper bound.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-range <adams.data.spreadsheet.SpreadSheetColumnRange> (property: range) The column range to normalize. default: first-last example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.-lower <double> (property: lower) The lower bound to use. default: 0.0
-upper <double> (property: upper) The upper bound to use. default: 1.0
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]m_Indicesthe indices of the columns to process.protected doublem_Lowerthe lower bound.protected double[]m_Maxthe maximum value for a column.protected double[]m_Minthe minimum value for a column.protected boolean[]m_Numericwhether a column is numeric.protected SpreadSheetColumnRangem_Rangethe column range to normalize.protected doublem_Upperthe upper bound.-
Fields inherited from class adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
m_Trained
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Normalize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcheckTrain(SpreadSheet data)Hook method for checks (training data).voiddefineOptions()Adds options to the internal list of options.protected SpreadSheetdoFilter(SpreadSheet data)Performs the actual filtering of the spreadsheet.protected SpreadSheetdoTrain(SpreadSheet data)Performs the actual retraining on the spreadsheet.doublegetLower()Returns the lower bound in use.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.SpreadSheetColumnRangegetRange()Returns the range of columns to process.doublegetUpper()Returns the upper bound in use.StringglobalInfo()Returns a string describing the object.StringlowerTipText()Returns the tip text for this property.StringrangeTipText()Returns the tip text for this property.voidsetLower(double value)Sets the lower bound to use.voidsetRange(SpreadSheetColumnRange value)Sets the range of columns to process.voidsetUpper(double value)Sets the upper bound to use.StringupperTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
filter, isTrained, resetFilter, train
-
Methods inherited from class adams.data.spreadsheet.filter.AbstractSpreadSheetFilter
check
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Range
protected SpreadSheetColumnRange m_Range
the column range to normalize.
-
m_Lower
protected double m_Lower
the lower bound.
-
m_Upper
protected double m_Upper
the upper bound.
-
m_Indices
protected int[] m_Indices
the indices of the columns to process.
-
m_Numeric
protected boolean[] m_Numeric
whether a column is numeric.
-
m_Min
protected double[] m_Min
the minimum value for a column.
-
m_Max
protected double[] m_Max
the maximum value for a column.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setRange
public void setRange(SpreadSheetColumnRange value)
Sets the range of columns to process.- Parameters:
value- the range
-
getRange
public SpreadSheetColumnRange getRange()
Returns the range of columns to process.- Returns:
- the range
-
rangeTipText
public String rangeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLower
public void setLower(double value)
Sets the lower bound to use.- Parameters:
value- the bound
-
getLower
public double getLower()
Returns the lower bound in use.- Returns:
- the bound
-
lowerTipText
public String lowerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUpper
public void setUpper(double value)
Sets the upper bound to use.- Parameters:
value- the bound
-
getUpper
public double getUpper()
Returns the upper bound in use.- Returns:
- the bound
-
upperTipText
public String upperTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractSpreadSheetFilter- Returns:
- null if no info available, otherwise short string
-
checkTrain
protected String checkTrain(SpreadSheet data)
Hook method for checks (training data).- Overrides:
checkTrainin classAbstractTrainableSpreadSheetFilter- Parameters:
data- the spreadsheet to filter- Returns:
- the filtered spreadsheet
-
doTrain
protected SpreadSheet doTrain(SpreadSheet data) throws Exception
Performs the actual retraining on the spreadsheet.- Specified by:
doTrainin classAbstractTrainableSpreadSheetFilter- Parameters:
data- the spreadsheet to train with and filter- Returns:
- the filtered spreadsheet
- Throws:
Exception- if filtering fails
-
doFilter
protected SpreadSheet doFilter(SpreadSheet data) throws Exception
Performs the actual filtering of the spreadsheet.- Specified by:
doFilterin classAbstractSpreadSheetFilter- Parameters:
data- the spreadsheet to filter- Returns:
- the filtered spreadsheet
- Throws:
Exception- if filtering fails
-
-