Class WekaFilter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.postprocessor.instances.AbstractPostProcessor
-
- adams.data.postprocessor.instances.AbstractSerializablePostProcessor
-
- adams.data.postprocessor.instances.WekaFilter
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SerializableObject
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
,Comparable
public class WekaFilter extends AbstractSerializablePostProcessor
Uses a WEKA filter for post-processing.
Automatically wraps a SpectrumFilter meta-filter around the actual filter.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-serialization-file <adams.core.io.PlaceholderFile> (property: serializationFile) The file to serialize the generated internal model to. default: ${CWD}
-override-serialized-file <boolean> (property: overrideSerializedFile) If set to true, then any serialized file will be ignored and the setup for serialization will be regenerated. default: false
-filter <weka.filters.Filter> (property: filter) The filter to use for processing the Instances. default: weka.filters.AllFilter
-wrap <boolean> (property: wrap) Whether to wrap the filter in a weka.filters.unsupervised.attribute.SpectrumFilter. default: true
- 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 WEKA filter to use.protected weka.filters.Filter
m_Filter
the WEKA filter to use.protected weka.core.Instances
m_FilteredInitData
the filtered data generated when initializing the postprocessor.protected boolean
m_Wrap
whether to wrap the filter in a SpectrumFilter.-
Fields inherited from class adams.data.postprocessor.instances.AbstractSerializablePostProcessor
m_InitData, m_OverrideSerializationFile, m_SerializableObjectHelper, m_SerializationFile
-
Fields inherited from class adams.data.postprocessor.instances.AbstractPostProcessor
m_FlowContext
-
-
Constructor Summary
Constructors Constructor Description WekaFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.String
filterTipText()
Returns the tip text for this property.protected weka.filters.Filter
getDefaultFilter()
Returns the default filter to use.weka.filters.Filter
getFilter()
Returns the filter in use.boolean
getWrap()
Returns whether to wrap the filter in aSpectrumFilter
.String
globalInfo()
Returns a string describing the object.void
initSerializationSetup()
Regenerates all the objects that are necessary for serialization.protected weka.core.Instance
performPostProcess(weka.core.Instance data)
Performs the actual postprocessing.protected weka.core.Instances
performPostProcess(weka.core.Instances data)
Performs the actual postprocessing.Object[]
retrieveSerializationSetup()
Returns the member variables to serialize to a file.void
setFilter(weka.filters.Filter value)
Sets the filter to use.void
setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.void
setWrap(boolean value)
Sets whether to wrap the filter in aSpectrumFilter
.String
wrapTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.postprocessor.instances.AbstractSerializablePostProcessor
destroy, getOverrideSerializedFile, getSerializationFile, initialize, isSetupLoadedOrGenerated, overrideSerializedFileTipText, preCheck, preCheck, reset, serializationFileTipText, setOverrideSerializedFile, setSerializationFile, setSetupLoadedOrGenerated
-
Methods inherited from class adams.data.postprocessor.instances.AbstractPostProcessor
compareTo, equals, forCommandLine, forName, getEvaluators, getFlowContext, postProcess, postProcess, setFlowContext, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Filter
protected weka.filters.Filter m_Filter
the WEKA filter to use.
-
m_ActualFilter
protected weka.filters.Filter m_ActualFilter
the actual WEKA filter to use.
-
m_FilteredInitData
protected weka.core.Instances m_FilteredInitData
the filtered data generated when initializing the postprocessor.
-
m_Wrap
protected boolean m_Wrap
whether to wrap the filter in a SpectrumFilter.
-
-
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 classAbstractSerializablePostProcessor
-
getDefaultFilter
protected weka.filters.Filter getDefaultFilter()
Returns the default filter to use.- Returns:
- the default filter
-
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.
-
setWrap
public void setWrap(boolean value)
Sets whether to wrap the filter in aSpectrumFilter
.- Parameters:
value
- true if to wrap
-
getWrap
public boolean getWrap()
Returns whether to wrap the filter in aSpectrumFilter
.- Returns:
- true if to wrap
-
wrapTipText
public String wrapTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initSerializationSetup
public void initSerializationSetup()
Regenerates all the objects that are necessary for serialization.
-
retrieveSerializationSetup
public Object[] retrieveSerializationSetup()
Returns the member variables to serialize to a file.- Returns:
- the objects to serialize
-
setSerializationSetup
public void setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.- Parameters:
value
- the deserialized objects
-
performPostProcess
protected weka.core.Instances performPostProcess(weka.core.Instances data)
Performs the actual postprocessing.- Specified by:
performPostProcess
in classAbstractPostProcessor
- Parameters:
data
- the dataset to process- Returns:
- the processed dataset
-
performPostProcess
protected weka.core.Instance performPostProcess(weka.core.Instance data)
Performs the actual postprocessing.- Specified by:
performPostProcess
in classAbstractPostProcessor
- Parameters:
data
- the instance to process- Returns:
- the processed instance
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
- Overrides:
cleanUp
in classAbstractSerializablePostProcessor
-
-