weka.filters.unsupervised.attribute

## Class RemoveByName

- java.lang.Object
- - weka.filters.Filter
  - - weka.filters.SimpleFilter
    - - weka.filters.SimpleStreamFilter
      - - weka.filters.unsupervised.attribute.RemoveByName

- All Implemented Interfaces:
    java.io.Serializable, CapabilitiesHandler, CapabilitiesIgnorer, OptionHandler, RevisionHandler, StreamableFilter

      public class RemoveByName
      extends SimpleStreamFilter

  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: 10394 $
  Author:
    FracPete (fracpete at waikato dot ac dot nz)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_EXPRESSION` the default expression.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoveByName()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `expressionTipText()` Returns the tip text for this property.
    `Capabilities` | `getCapabilities()` Returns the Capabilities of this filter.
    `java.lang.String` | `getExpression()` Returns the regular expression in use.
    `boolean` | `getInvertSelection()` Get whether the supplied columns are to be removed or kept.
    `java.lang.String[]` | `getOptions()` returns the options of the current setup.
    `java.lang.String` | `getRevision()` Returns the revision string.
    `java.lang.String` | `globalInfo()` Returns a string describing this classifier.
    `java.lang.String` | `invertSelectionTipText()` Returns the tip text for this property.
    `java.util.Enumeration<Option>` | `listOptions()` Gets an enumeration describing the available options.
    `static void` | `main(java.lang.String[] args)` runs the filter with the given arguments.
    `void` | `setExpression(java.lang.String value)` Sets the regular expression to match the attribute names against.
    `void` | `setInvertSelection(boolean value)` Set whether selected columns should be removed or kept.
    `void` | `setOptions(java.lang.String[] options)` Parses the options for this object.

    - ### Methods inherited from class weka.filters.SimpleStreamFilter

      `batchFinished, input`

    - ### Methods inherited from class weka.filters.SimpleFilter

      `setInputFormat`

    - ### Methods inherited from class weka.filters.Filter

      `batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_EXPRESSION

          public static final java.lang.String DEFAULT_EXPRESSION

      the default expression.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RemoveByName

          public RemoveByName()

  - ### Method Detail

    - #### globalInfo

          public java.lang.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 java.util.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 java.lang.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(java.lang.String[] options)
                          throws java.lang.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:
        `java.lang.Exception` - if the option setting fails

    - #### setExpression

          public void setExpression(java.lang.String value)

      Sets the regular expression to match the attribute names against.
      Parameters:
        `value` - the regular expression

    - #### getExpression

          public java.lang.String getExpression()

      Returns the regular expression in use.
      Returns:
        the regular expression

    - #### expressionTipText

          public java.lang.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 java.lang.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:
        `Capabilities`

    - #### getRevision

          public java.lang.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(java.lang.String[] args)

      runs the filter with the given arguments.
      Parameters:
        `args` - the commandline arguments