public class PartitionedMultiFilter extends SimpleBatchFilter implements WeightedInstancesHandler, WeightedAttributesHandler
-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
-R <range> An attribute range (can be specified multiple times). For each filter a range must be supplied. 'first' and 'last' are valid indices. 'inv(...)' around the range denotes an inverted range.
-U Flag for leaving unused attributes out of the output, by default these are included in the filter output.
StreamableFilter,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Filter[] |
m_Filters
The filters.
|
protected int[] |
m_IndicesUnused
the indices of the unused attributes.
|
protected Range[] |
m_Ranges
The attribute ranges.
|
protected boolean |
m_RemoveUnused
Whether unused attributes are left out of the output.
|
m_Debug, m_DoNotCheckCapabilities, m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts| Constructor and Description |
|---|
PartitionedMultiFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkDimensions()
checks whether the dimensions of filters and ranges fit together.
|
protected Instances |
determineOutputFormat(Instances inputFormat)
Determines the output format based only on the full input dataset and
returns this otherwise null is returned.
|
protected void |
determineUnusedIndices(Instances data)
determines the indices of unused attributes (ones that are not covered by
any of the range).
|
java.lang.String |
filtersTipText()
Returns the tip text for this property.
|
protected Instances |
generateSubset(Instances data,
Range range)
generates a subset of the dataset with only the attributes from the range
(class is always added if present).
|
Filter |
getFilter(int index)
Gets a single filter from the set of available filters.
|
Filter[] |
getFilters()
Gets the list of possible filters to choose from.
|
protected java.lang.String |
getFilterSpec(Filter filter)
returns the filter classname and the options as one string.
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
Range |
getRange(int index)
Gets a single Range from the set of available Ranges.
|
Range[] |
getRanges()
Gets the list of possible Ranges to choose from.
|
boolean |
getRemoveUnused()
Gets whether unused attributes (ones that are not covered by any of the
ranges) are removed from the output.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this filter.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for executing this class.
|
protected Instances |
process(Instances instances)
Processes the given data (may change the provided dataset) and returns the
modified version.
|
java.lang.String |
rangesTipText()
Returns the tip text for this property.
|
java.lang.String |
removeUnusedTipText()
Returns the tip text for this property.
|
protected Instances |
renameAttributes(Instances data,
java.lang.String prefix)
renames all the attributes in the dataset (excluding the class if present)
by adding the prefix to the name.
|
void |
setFilters(Filter[] filters)
Sets the list of possible filters to choose from.
|
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object.
|
void |
setRanges(Range[] Ranges)
Sets the list of possible Ranges to choose from.
|
void |
setRemoveUnused(boolean value)
Sets whether unused attributes (ones that are not covered by any of the
ranges) are removed from the output.
|
protected void |
testInputFormat(Instances instanceInfo)
tests the data whether the filter can actually handle it.
|
allowAccessToFullInputFormat, batchFinished, hasImmediateOutputFormat, inputreset, setInputFormatbatchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, toString, useFilter, wekaStaticWrapperprotected Filter[] m_Filters
protected Range[] m_Ranges
protected boolean m_RemoveUnused
protected int[] m_IndicesUnused
public java.lang.String globalInfo()
globalInfo in class SimpleFilterpublic java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Filterpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
-R <range> An attribute range (can be specified multiple times). For each filter a range must be supplied. 'first' and 'last' are valid indices. 'inv(...)' around the range denotes an inverted range.
-U Flag for leaving unused attributes out of the output, by default these are included in the filter output.
setOptions in interface OptionHandlersetOptions in class Filteroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Filterprotected void checkDimensions()
throws java.lang.Exception
java.lang.Exception - if dimensions differprotected void testInputFormat(Instances instanceInfo) throws java.lang.Exception
testInputFormat in class FilterinstanceInfo - the data to testjava.lang.Exception - if the test failspublic void setRemoveUnused(boolean value)
value - if true then the unused attributes get removedpublic boolean getRemoveUnused()
public java.lang.String removeUnusedTipText()
public void setFilters(Filter[] filters)
filters - an array of filters with all options set.SimpleFilter.reset()public Filter[] getFilters()
public java.lang.String filtersTipText()
public Filter getFilter(int index)
index - the index of the filter wantedprotected java.lang.String getFilterSpec(Filter filter)
filter - the filter to get the specs forpublic void setRanges(Range[] Ranges)
Ranges - an array of Ranges with all options set.SimpleFilter.reset()public Range[] getRanges()
public java.lang.String rangesTipText()
public Range getRange(int index)
index - the index of the Range wantedprotected void determineUnusedIndices(Instances data)
data - the data to base the determination onm_IndicesUnusedprotected Instances generateSubset(Instances data, Range range) throws java.lang.Exception
data - the data to work onrange - the range of attribute to usejava.lang.Exception - if creation failsprotected Instances renameAttributes(Instances data, java.lang.String prefix) throws java.lang.Exception
data - the data to work onprefix - the prefix for the attributesjava.lang.Exception - if renaming failsprotected Instances determineOutputFormat(Instances inputFormat) throws java.lang.Exception
determineOutputFormat in class SimpleFilterinputFormat - the input format to base the output format onjava.lang.Exception - in case the determination goes wrongSimpleBatchFilter.hasImmediateOutputFormat(),
SimpleBatchFilter.batchFinished()protected Instances process(Instances instances) throws java.lang.Exception
process in class SimpleFilterinstances - the data to processjava.lang.Exception - in case the processing goes wrongSimpleBatchFilter.batchFinished()public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] args)
args - should contain arguments for the filter: use -h for help