Class 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 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.
    • Constructor Detail

      • WekaFilter

        public WekaFilter()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractSerializablePostProcessor
      • 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 a SpectrumFilter.
        Parameters:
        value - true if to wrap
      • getWrap

        public boolean getWrap()
        Returns whether to wrap the filter in a SpectrumFilter.
        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 class AbstractPostProcessor
        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 class AbstractPostProcessor
        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 interface adams.core.CleanUpHandler
        Overrides:
        cleanUp in class AbstractSerializablePostProcessor