Package adams.data.spreadsheet.filter
Class WekaFilter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.filter.AbstractSpreadSheetFilter
-
- adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
-
- adams.data.spreadsheet.filter.WekaFilter
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,adams.data.spreadsheet.filter.SpreadSheetFilter
,adams.data.spreadsheet.filter.TrainableSpreadSheetFilter
,Serializable
public class WekaFilter extends adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
Applies a Weka filter to the data.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.filters.Filter
m_ActualFilter
the actual filter in use.protected weka.filters.Filter
m_Filter
the filter to use.protected int
m_MaxLabels
the threshold for number of labels before an attribute gets switched toAttribute.STRING
.
-
Constructor Summary
Constructors Constructor Description WekaFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected adams.data.spreadsheet.SpreadSheet
doFilter(adams.data.spreadsheet.SpreadSheet data)
Performs the actual filtering of the spreadsheet.protected adams.data.spreadsheet.SpreadSheet
doTrain(adams.data.spreadsheet.SpreadSheet data)
Performs the actual retraining on the spreadsheet.String
filterTipText()
Returns the tip text for this property.weka.filters.Filter
getFilter()
Returns the filter in use.int
getMaxLabels()
Returns the name of the global actor in use.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
maxLabelsTipText()
Returns the tip text for this property.void
setFilter(weka.filters.Filter value)
Sets the filter to use.void
setMaxLabels(int value)
Sets the maximum number of labels a nominal attribute can have.protected weka.core.Instances
toInstances(adams.data.spreadsheet.SpreadSheet data)
Converts the spreadsheet into an Instances object.protected adams.data.spreadsheet.SpreadSheet
toSpreadSheet(weka.core.Instances data)
Converts the Instances into a SpreadSheet object.-
Methods inherited from class adams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
checkTrain, filter, isTrained, resetFilter, train
-
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
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setFilter
public void setFilter(weka.filters.Filter value)
Sets the filter to use.- Parameters:
value
- the filter
-
getFilter
public weka.filters.Filter getFilter()
Returns the filter in use.- Returns:
- the filter
-
filterTipText
public String filterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxLabels
public void setMaxLabels(int value)
Sets the maximum number of labels a nominal attribute can have.- Parameters:
value
- the maximum
-
getMaxLabels
public int getMaxLabels()
Returns the name of the global actor in use.- Returns:
- the global name
-
maxLabelsTipText
public String maxLabelsTipText()
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:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classadams.data.spreadsheet.filter.AbstractSpreadSheetFilter
- Returns:
- null if no info available, otherwise short string
-
toInstances
protected weka.core.Instances toInstances(adams.data.spreadsheet.SpreadSheet data)
Converts the spreadsheet into an Instances object.- Parameters:
data
- the spreadsheet to convert- Returns:
- the Instances
-
toSpreadSheet
protected adams.data.spreadsheet.SpreadSheet toSpreadSheet(weka.core.Instances data)
Converts the Instances into a SpreadSheet object.- Parameters:
data
- the Instances to convert- Returns:
- the SpreadSheet
-
doTrain
protected adams.data.spreadsheet.SpreadSheet doTrain(adams.data.spreadsheet.SpreadSheet data) throws Exception
Performs the actual retraining on the spreadsheet.- Specified by:
doTrain
in classadams.data.spreadsheet.filter.AbstractTrainableSpreadSheetFilter
- Parameters:
data
- the spreadsheet to train with and filter- Returns:
- the filtered spreadsheet
- Throws:
Exception
- if filtering fails
-
doFilter
protected adams.data.spreadsheet.SpreadSheet doFilter(adams.data.spreadsheet.SpreadSheet data) throws Exception
Performs the actual filtering of the spreadsheet.- Specified by:
doFilter
in classadams.data.spreadsheet.filter.AbstractSpreadSheetFilter
- Parameters:
data
- the spreadsheet to filter- Returns:
- the filtered spreadsheet
- Throws:
Exception
- if filtering fails
-
-