Class RemoveByName

All Implemented Interfaces:
Serializable, CapabilitiesHandler, CapabilitiesIgnorer, CommandlineRunnable, OptionHandler, RevisionHandler, WeightedAttributesHandler, WeightedInstancesHandler, StreamableFilter

public class RemoveByName extends SimpleStreamFilter implements WeightedInstancesHandler, WeightedAttributesHandler
Removes attributes based on a regular expression matched against their names.

Valid options are:

 -D
  Turns on output of debugging information.
 
 -E <regular expression>
  The regular expression to match the attribute names against.
  (default: ^.*id$)
 
 -V
  Flag for inverting the matching sense. If set, attributes are kept
  instead of deleted.
  (default: off)
 
Version:
$Revision: 14508 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Details

  • Constructor Details

    • RemoveByName

      public RemoveByName()
  • Method Details

    • globalInfo

      public String globalInfo()
      Returns a string describing this classifier.
      Specified by:
      globalInfo in class SimpleFilter
      Returns:
      a description of the classifier suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration<Option> listOptions()
      Gets an enumeration describing the available options.
      Specified by:
      listOptions in interface OptionHandler
      Overrides:
      listOptions in class Filter
      Returns:
      an enumeration of all the available options.
    • getOptions

      public String[] getOptions()
      returns the options of the current setup.
      Specified by:
      getOptions in interface OptionHandler
      Overrides:
      getOptions in class Filter
      Returns:
      the current options
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses the options for this object.

      Valid options are:

       -D
        Turns on output of debugging information.
       
       -E <regular expression>
        The regular expression to match the attribute names against.
        (default: ^.*id$)
       
       -V
        Flag for inverting the matching sense. If set, attributes are kept
        instead of deleted.
        (default: off)
       
      Specified by:
      setOptions in interface OptionHandler
      Overrides:
      setOptions in class Filter
      Parameters:
      options - the options to use
      Throws:
      Exception - if the option setting fails
    • setExpression

      public void setExpression(String value)
      Sets the regular expression to match the attribute names against.
      Parameters:
      value - the regular expression
    • getExpression

      public String getExpression()
      Returns the regular expression in use.
      Returns:
      the regular expression
    • expressionTipText

      public String expressionTipText()
      Returns the tip text for this property.
      Returns:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setInvertSelection

      public void setInvertSelection(boolean value)
      Set whether selected columns should be removed or kept. If true the selected columns are kept and unselected columns are deleted. If false selected columns are deleted and unselected columns are kept.
      Parameters:
      value - the new invert setting
    • getInvertSelection

      public boolean getInvertSelection()
      Get whether the supplied columns are to be removed or kept.
      Returns:
      true if the supplied columns will be kept
    • invertSelectionTipText

      public String invertSelectionTipText()
      Returns the tip text for this property.
      Returns:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getCapabilities

      public Capabilities getCapabilities()
      Returns the Capabilities of this filter.
      Specified by:
      getCapabilities in interface CapabilitiesHandler
      Overrides:
      getCapabilities in class Filter
      Returns:
      the capabilities of this object
      See Also:
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      Overrides:
      getRevision in class Filter
      Returns:
      the revision
    • main

      public static void main(String[] args)
      runs the filter with the given arguments.
      Parameters:
      args - the commandline arguments