public class RandomSubset extends SimpleStreamFilter
-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)
Modifier and Type | Field and Description |
---|---|
protected int[] |
m_Indices
The indices of the attributes that got selected.
|
protected double |
m_NumAttributes
The number of attributes to randomly choose (>= 1 absolute number of
attributes, < 1 percentage).
|
protected int |
m_Seed
The seed value.
|
m_Debug
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
Constructor and Description |
---|
RandomSubset() |
Modifier and Type | Method and Description |
---|---|
protected Instances |
determineOutputFormat(Instances inputFormat)
Determines the output format based on the input format and returns
this.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
double |
getNumAttributes()
Get the number of attributes (< 1 percentage, >= 1 absolute number).
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Get the seed value for the random number generator.
|
String |
globalInfo()
Returns a string describing this filter.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Runs the filter with the given parameters.
|
String |
numAttributesTipText()
Returns the tip text for this property.
|
protected Instance |
process(Instance instance)
processes the given instance (may change the provided instance) and
returns the modified version.
|
String |
seedTipText()
Returns the tip text for this property.
|
void |
setNumAttributes(double value)
Set the number of attributes.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setSeed(int value)
Set the seed value for the random number generator.
|
batchFinished, hasImmediateOutputFormat, input, preprocess, process
debugTipText, getDebug, reset, setDebug, setInputFormat
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
protected double m_NumAttributes
protected int m_Seed
protected int[] m_Indices
public String globalInfo()
globalInfo
in class SimpleFilter
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SimpleFilter
public String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SimpleFilter
public void setOptions(String[] options) throws Exception
-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
in interface OptionHandler
setOptions
in class SimpleFilter
options
- the list of options as an array of stringsException
- if an option is not supportedSimpleFilter.reset()
public String numAttributesTipText()
public double getNumAttributes()
public void setNumAttributes(double value)
value
- the number of attributes to use.public String seedTipText()
public int getSeed()
public void setSeed(int value)
value
- the seed value.public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
protected Instances determineOutputFormat(Instances inputFormat) throws Exception
determineOutputFormat
in class SimpleStreamFilter
inputFormat
- the input format to base the output format onException
- in case the determination goes wrongSimpleStreamFilter.hasImmediateOutputFormat()
,
SimpleStreamFilter.batchFinished()
,
SimpleStreamFilter.preprocess(Instances)
protected Instance process(Instance instance) throws Exception
process
in class SimpleStreamFilter
instance
- the instance to processException
- in case the processing goes wrongpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- the commandline optionsCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.