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.AbstractTrainableSpreadSheetFilterApplies 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.Filterm_ActualFilterthe actual filter in use.protected weka.filters.Filterm_Filterthe filter to use.protected intm_MaxLabelsthe 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 voiddefineOptions()Adds options to the internal list of options.protected adams.data.spreadsheet.SpreadSheetdoFilter(adams.data.spreadsheet.SpreadSheet data)Performs the actual filtering of the spreadsheet.protected adams.data.spreadsheet.SpreadSheetdoTrain(adams.data.spreadsheet.SpreadSheet data)Performs the actual retraining on the spreadsheet.StringfilterTipText()Returns the tip text for this property.weka.filters.FiltergetFilter()Returns the filter in use.intgetMaxLabels()Returns the name of the global actor in use.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.StringmaxLabelsTipText()Returns the tip text for this property.voidsetFilter(weka.filters.Filter value)Sets the filter to use.voidsetMaxLabels(int value)Sets the maximum number of labels a nominal attribute can have.protected weka.core.InstancestoInstances(adams.data.spreadsheet.SpreadSheet data)Converts the spreadsheet into an Instances object.protected adams.data.spreadsheet.SpreadSheettoSpreadSheet(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:
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 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:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin 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 ExceptionPerforms the actual retraining on the spreadsheet.- Specified by:
doTrainin 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 ExceptionPerforms the actual filtering of the spreadsheet.- Specified by:
doFilterin classadams.data.spreadsheet.filter.AbstractSpreadSheetFilter- Parameters:
data- the spreadsheet to filter- Returns:
- the filtered spreadsheet
- Throws:
Exception- if filtering fails
-
-