Class RandomSubset
java.lang.Object
weka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.RandomSubset
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,OptionHandler,RevisionHandler,StreamableFilter
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)
- Version:
- $Revision: 5547 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Capabilities of this filter.doubleGet the number of attributes (< 1 percentage, >= 1 absolute number).String[]Gets the current settings of the filter.Returns the revision string.intgetSeed()Get the seed value for the random number generator.Returns a string describing this filter.Returns an enumeration describing the available options.static voidRuns the filter with the given parameters.Returns the tip text for this property.Returns the tip text for this property.voidsetNumAttributes(double value) Set the number of attributes.voidsetOptions(String[] options) Parses a given list of options.voidsetSeed(int value) Set the seed value for the random number generator.Methods inherited from class weka.filters.SimpleStreamFilter
batchFinished, inputMethods inherited from class weka.filters.SimpleFilter
debugTipText, getDebug, setDebug, setInputFormatMethods inherited from class weka.filters.Filter
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
-
Constructor Details
-
RandomSubset
public RandomSubset()
-
-
Method Details
-
globalInfo
Returns a string describing this filter.- Specified by:
globalInfoin classSimpleFilter- Returns:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classSimpleFilter- Returns:
- an enumeration of all the available options.
-
getOptions
Gets the current settings of the filter.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classSimpleFilter- Returns:
- an array of strings suitable for passing to setOptions
-
setOptions
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)
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classSimpleFilter- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported- See Also:
-
SimpleFilter.reset()
-
numAttributesTipText
Returns the tip text for this property.- Returns:
- 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).- Returns:
- the number of attributes.
-
setNumAttributes
public void setNumAttributes(double value) Set the number of attributes.- Parameters:
value- the number of attributes to use.
-
seedTipText
Returns the tip text for this property.- Returns:
- 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.- Returns:
- the seed value.
-
setSeed
public void setSeed(int value) Set the seed value for the random number generator.- Parameters:
value- the seed value.
-
getCapabilities
Returns the Capabilities of this filter.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classFilter- Returns:
- the capabilities of this object
- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classFilter- Returns:
- the revision
-
main
Runs the filter with the given parameters. Use -h to list options.- Parameters:
args- the commandline options
-