public class PropositionalToMultiInstance extends Filter implements OptionHandler, UnsupervisedFilter
-S <num> The seed for the randomization of the order of bags. (default 1)
-R Randomizes the order of the produced bags after the generation. (default off)
MultiInstanceToPropositional
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected RelationalLocator |
m_BagRelAtts
Indices of relational attributes in the bag
|
protected StringLocator |
m_BagStringAtts
Indices of string attributes in the bag
|
protected boolean |
m_Randomize
whether to randomize the output data
|
protected int |
m_Seed
the seed for randomizing, default is 1
|
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
Constructor and Description |
---|
PropositionalToMultiInstance() |
Modifier and Type | Method and Description |
---|---|
protected void |
addBag(Instances input,
Instances output,
Instances bagInsts,
int bagIndex,
double classValue,
double bagWeight)
adds a new bag out of the given data and adds it to the output
|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
String[] |
getOptions()
Gets the current settings of the classifier.
|
boolean |
getRandomize()
Gets whether the order of the generated is randomized
|
String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Returns the current seed value for randomizing the order of the generated
data
|
String |
globalInfo()
Returns a string describing this filter
|
Enumeration |
listOptions()
Returns an enumeration describing the available options
|
static void |
main(String[] args)
Main method for running this filter.
|
protected void |
push(Instance instance)
Adds an output instance to the queue.
|
String |
randomizeTipText()
Returns the tip text for this property
|
String |
seedTipText()
Returns the tip text for this property
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setRandomize(boolean value)
Sets whether the order of the generated data is randomized
|
void |
setSeed(int value)
Sets the new seed for randomizing the order of the generated data
|
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, input, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
protected int m_Seed
protected boolean m_Randomize
protected StringLocator m_BagStringAtts
protected RelationalLocator m_BagRelAtts
public String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-S <num> The seed for the randomization of the order of bags. (default 1)
-R Randomizes the order of the produced bags after the generation. (default off)
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public String seedTipText()
public void setSeed(int value)
value
- the new seed valuepublic int getSeed()
public void setRandomize(boolean value)
value
- whether to randomize or notpublic boolean getRandomize()
public String randomizeTipText()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean setInputFormat(Instances instanceInfo) throws Exception
setInputFormat
in class Filter
instanceInfo
- an Instances object containing the input
instance structure (any instances contained in the object are
ignored - only the structure is required).Exception
- if the input format can't be set
successfullyprotected void addBag(Instances input, Instances output, Instances bagInsts, int bagIndex, double classValue, double bagWeight)
input
- the intput datasetoutput
- the dataset this bag is added tobagInsts
- the instances in this bagbagIndex
- the bagIndex of this bagclassValue
- the associated class valuebagWeight
- the weight of the bagprotected void push(Instance instance)
public boolean batchFinished()
batchFinished
in class Filter
IllegalStateException
- if no input structure has been definedpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- should contain arguments to the filter:
use -h for helpCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.