类 RandomSubset

所有已实现的接口:
Serializable, CapabilitiesHandler, OptionHandler, RevisionHandler, StreamableFilter

public class RandomSubset extends SimpleStreamFilter
Chooses a random subset of attributes, either an absolute number or a percentage. The class is always included in the output (as the last attribute).

Valid options are:

 -D
  Turns on output of debugging information.
 -N <double>
  The number of attributes to randomly select.
  If < 1 then percentage, >= 1 absolute number.
  (default: 0.5)
 -S <int>
  The seed value.
  (default: 1)
版本:
$Revision: 5547 $
作者:
fracpete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • RandomSubset

      public RandomSubset()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing this filter.
      指定者:
      globalInfo 在类中 SimpleFilter
      返回:
      a description of the filter suitable for displaying in the explorer/experimenter gui
    • listOptions

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

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

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

      Valid options are:

       -D
        Turns on output of debugging information.
       -N <double>
        The number of attributes to randomly select.
        If < 1 then percentage, >= 1 absolute number.
        (default: 0.5)
       -S <int>
        The seed value.
        (default: 1)
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 SimpleFilter
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
      另请参阅:
      • SimpleFilter.reset()
    • numAttributesTipText

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

      public double getNumAttributes()
      Get the number of attributes (< 1 percentage, >= 1 absolute number).
      返回:
      the number of attributes.
    • setNumAttributes

      public void setNumAttributes(double value)
      Set the number of attributes.
      参数:
      value - the number of attributes to use.
    • seedTipText

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

      public int getSeed()
      Get the seed value for the random number generator.
      返回:
      the seed value.
    • setSeed

      public void setSeed(int value)
      Set the seed value for the random number generator.
      参数:
      value - the seed value.
    • getCapabilities

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

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

      public static void main(String[] args)
      Runs the filter with the given parameters. Use -h to list options.
      参数:
      args - the commandline options