Package adams.data.spreadsheet.filter
Class Standardize
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,SpreadSheetFilter
,TrainableSpreadSheetFilter
,Serializable
public class Standardize extends AbstractTrainableSpreadSheetFilter
Standardizes numeric columns to mean 0.0 and standard deviation 1.0.
-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 standardize. 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.
- 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_Indices
the indices of the columns to process.protected double[]
m_Means
the means.protected boolean[]
m_Numeric
whether a column is numeric.protected SpreadSheetColumnRange
m_Range
the column range to normalize.protected double[]
m_StdDevs
the stddevs.-
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 Standardize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected SpreadSheet
doFilter(SpreadSheet data)
Performs the actual filtering of the spreadsheet.protected SpreadSheet
doTrain(SpreadSheet data)
Performs the actual retraining on the spreadsheet.SpreadSheetColumnRange
getRange()
Returns the range of columns to process.String
globalInfo()
Returns a string describing the object.String
rangeTipText()
Returns the tip text for this property.void
setRange(SpreadSheetColumnRange value)
Sets the range of columns to process.-
Methods inherited from class adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
checkTrain, filter, isTrained, resetFilter, train
-
Methods inherited from class adams.data.spreadsheet.filter.AbstractSpreadSheetFilter
check, getQuickInfo
-
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_Indices
protected int[] m_Indices
the indices of the columns to process.
-
m_Numeric
protected boolean[] m_Numeric
whether a column is numeric.
-
m_Means
protected double[] m_Means
the means.
-
m_StdDevs
protected double[] m_StdDevs
the stddevs.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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.
-
doTrain
protected SpreadSheet doTrain(SpreadSheet data) throws Exception
Performs the actual retraining on the spreadsheet.- Specified by:
doTrain
in 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:
doFilter
in classAbstractSpreadSheetFilter
- Parameters:
data
- the spreadsheet to filter- Returns:
- the filtered spreadsheet
- Throws:
Exception
- if filtering fails
-
-