类 RemoveWithValues

java.lang.Object
weka.filters.Filter
weka.filters.unsupervised.instance.RemoveWithValues
所有已实现的接口:
Serializable, CapabilitiesHandler, OptionHandler, RevisionHandler, StreamableFilter, UnsupervisedFilter

public class RemoveWithValues extends Filter implements UnsupervisedFilter, StreamableFilter, OptionHandler
Filters instances according to the value of an attribute.

Valid options are:

 -C <num>
  Choose attribute to be used for selection.
 -S <num>
  Numeric value to be used for selection on numeric
  attribute.
  Instances with values smaller than given value will
  be selected. (default 0)
 -L <index1,index2-index4,...>
  Range of label indices to be used for selection on
  nominal attribute.
  First and last are valid indexes. (default all values)
 -M
  Missing values count as a match. This setting is
  independent of the -V option.
  (default missing values don't match)
 -V
  Invert matching sense.
 -H
  When selecting on nominal attributes, removes header
  references to excluded values.
 -F
  Do not apply the filter to instances that arrive after the first
  (training) batch. The default is to apply the filter (i.e.
  the filter may not return an instance if it matches the remove criteria)
版本:
$Revision: 8593 $
作者:
Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • RemoveWithValues

      public RemoveWithValues()
      Default constructor
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing this classifier
      返回:
      a description of the classifier suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.

      Valid options are:

       -C <num>
        Choose attribute to be used for selection.
       -S <num>
        Numeric value to be used for selection on numeric
        attribute.
        Instances with values smaller than given value will
        be selected. (default 0)
       -L <index1,index2-index4,...>
        Range of label indices to be used for selection on
        nominal attribute.
        First and last are valid indexes. (default all values)
       -M
        Missing values count as a match. This setting is
        independent of the -V option.
        (default missing values don't match)
       -V
        Invert matching sense.
       -H
        When selecting on nominal attributes, removes header
        references to excluded values.
       -F
        Do not apply the filter to instances that arrive after the first
        (training) batch. The default is to apply the filter (i.e.
        the filter may not return an instance if it matches the remove criteria)
      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the filter.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions
    • getCapabilities

      public Capabilities getCapabilities()
      Returns the Capabilities of this filter.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 Filter
      返回:
      the capabilities of this object
      另请参阅:
    • setInputFormat

      public boolean setInputFormat(Instances instanceInfo) throws Exception
      Sets the format of the input instances.
      覆盖:
      setInputFormat 在类中 Filter
      参数:
      instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
      返回:
      true because outputFormat can be collected immediately
      抛出:
      UnsupportedAttributeTypeException - if the specified attribute is neither numeric or nominal.
      Exception - if the inputFormat can't be set successfully
    • input

      public boolean input(Instance instance)
      Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output.
      覆盖:
      input 在类中 Filter
      参数:
      instance - the input instance
      返回:
      true if the filtered instance may now be collected with output().
      抛出:
      IllegalStateException - if no input format has been set.
    • isNominal

      public boolean isNominal()
      Returns true if selection attribute is nominal.
      返回:
      true if selection attribute is nominal
    • isNumeric

      public boolean isNumeric()
      Returns true if selection attribute is numeric.
      返回:
      true if selection attribute is numeric
    • modifyHeaderTipText

      public String modifyHeaderTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getModifyHeader

      public boolean getModifyHeader()
      Gets whether the header will be modified when selecting on nominal attributes.
      返回:
      true if so.
    • setModifyHeader

      public void setModifyHeader(boolean newModifyHeader)
      Sets whether the header will be modified when selecting on nominal attributes.
      参数:
      newModifyHeader - true if so.
    • attributeIndexTipText

      public String attributeIndexTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getAttributeIndex

      public String getAttributeIndex()
      Get the index of the attribute used.
      返回:
      the index of the attribute
    • setAttributeIndex

      public void setAttributeIndex(String attIndex)
      Sets index of the attribute used.
      参数:
      attIndex - the index of the attribute
    • splitPointTipText

      public String splitPointTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getSplitPoint

      public double getSplitPoint()
      Get the split point used for numeric selection
      返回:
      the numeric split point
    • setSplitPoint

      public void setSplitPoint(double value)
      Split point to be used for selection on numeric attribute.
      参数:
      value - the split point
    • matchMissingValuesTipText

      public String matchMissingValuesTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getMatchMissingValues

      public boolean getMatchMissingValues()
      Gets whether missing values are counted as a match.
      返回:
      true if missing values are counted as a match.
    • setMatchMissingValues

      public void setMatchMissingValues(boolean newMatchMissingValues)
      Sets whether missing values are counted as a match.
      参数:
      newMatchMissingValues - true if missing values are counted as a match.
    • invertSelectionTipText

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

      public boolean getInvertSelection()
      Get whether the supplied columns are to be removed or kept
      返回:
      true if the supplied columns will be kept
    • setInvertSelection

      public void setInvertSelection(boolean invert)
      Set whether selected values should be removed or kept. If true the selected values are kept and unselected values are deleted.
      参数:
      invert - the new invert setting
    • nominalIndicesTipText

      public String nominalIndicesTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getNominalIndices

      public String getNominalIndices()
      Get the set of nominal value indices that will be used for selection
      返回:
      rangeList a string representing the list of nominal indices.
    • setNominalIndices

      public void setNominalIndices(String rangeList)
      Set which nominal labels are to be included in the selection.
      参数:
      rangeList - a string representing the list of nominal indices. eg: first-3,5,6-last
      抛出:
      InvalidArgumentException - if an invalid range list is supplied
    • setDontFilterAfterFirstBatch

      public void setDontFilterAfterFirstBatch(boolean b)
      Set whether to apply the filter to instances that arrive once the first (training) batch has been seen. The default is to not apply the filter and just return each instance input. This is so that, when used in the FilteredClassifier, a test instance does not get "consumed" by the filter and a prediction is always generated.
      参数:
      b - true if the filter should *not* be applied to instances that arrive after the first (training) batch has been processed.
    • getDontFilterAfterFirstBatch

      public boolean getDontFilterAfterFirstBatch()
      Get whether to apply the filter to instances that arrive once the first (training) batch has been seen. The default is to not apply the filter and just return each instance input. This is so that, when used in the FilteredClassifier, a test instance does not get "consumed" by the filter and a prediction is always generated.
      返回:
      true if the filter should *not* be applied to instances that arrive after the first (training) batch has been processed.
    • dontFilterAfterFirstBatchTipText

      public String dontFilterAfterFirstBatchTipText()
      Returns the tip text for this property.
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setNominalIndicesArr

      public void setNominalIndicesArr(int[] values)
      Set which values of a nominal attribute are to be used for selection.
      参数:
      values - an array containing indexes of values to be used for selection
      抛出:
      InvalidArgumentException - if an invalid set of ranges is supplied
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 Filter
      返回:
      the revision
    • main

      public static void main(String[] argv)
      Main method for testing this class.
      参数:
      argv - should contain arguments to the filter: use -h for help