|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleBatchFilter
weka.filters.unsupervised.instance.SafeRemoveRange
public class SafeRemoveRange
A filter that removes a given range of instances of a dataset.
Works just like weka.filters.unsupervised.instance.RemoveRange, but has a more robust handling of instance ranges. E.g., removal of 30-100 will not result in an error when presenting only 20 or 40 instances, but return no instance or instances 30-40 instead.
-R <inst1,inst2-inst4,...> Specifies list of instances to select. First and last are valid indexes. (required)
-V Specifies if inverse of selection is to be output.
| Field Summary | |
|---|---|
protected boolean |
m_InvertSelection
whether to invert the selection. |
protected Range |
m_Range
Range of instances requested by the user. |
| Fields inherited from class weka.filters.SimpleFilter |
|---|
m_Debug |
| Fields inherited from class weka.filters.Filter |
|---|
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts |
| Constructor Summary | |
|---|---|
SafeRemoveRange()
|
|
| Method Summary | |
|---|---|
protected weka.core.Instances |
determineOutputFormat(weka.core.Instances inputFormat)
Determines the output format based on the input format and returns this. |
weka.core.Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
String |
getInstancesIndices()
Gets ranges of instances selected. |
boolean |
getInvertSelection()
Gets if selection is to be inverted. |
String[] |
getOptions()
Gets the current settings of the filter. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing this filter |
String |
instancesIndicesTipText()
Returns the tip text for this property. |
String |
invertSelectionTipText()
Returns the tip text for this property. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Main method for running this filter from command-line. |
protected weka.core.Instances |
process(weka.core.Instances instances)
Processes the given data (may change the provided dataset) and returns the modified version. |
void |
setInstancesIndices(String value)
Sets the range of instances to be selected. |
void |
setInvertSelection(boolean value)
Sets if selection is to be inverted. |
void |
setOptions(String[] options)
Parses a given list of options. |
| Methods inherited from class weka.filters.SimpleBatchFilter |
|---|
batchFinished, hasImmediateOutputFormat, input |
| Methods inherited from class weka.filters.SimpleFilter |
|---|
debugTipText, getDebug, reset, setDebug, setInputFormat |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Range m_Range
protected boolean m_InvertSelection
| Constructor Detail |
|---|
public SafeRemoveRange()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class weka.filters.SimpleFilterpublic Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.filters.SimpleFilter
public void setOptions(String[] options)
throws Exception
-R <inst1,inst2-inst4,...> Specifies list of instances to select. First and last are valid indexes. (required)
-V Specifies if inverse of selection is to be output.
setOptions in interface weka.core.OptionHandlersetOptions in class weka.filters.SimpleFilteroptions - the list of options as an array of string.s
Exception - if an option is not supported.public String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.filters.SimpleFilterpublic void setInstancesIndices(String value)
value - a string representing the list of instances.
eg: first-3,5,6-lastpublic String getInstancesIndices()
public String instancesIndicesTipText()
public void setInvertSelection(boolean value)
value - true if inversion is to be performedpublic boolean getInvertSelection()
public String invertSelectionTipText()
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.filters.FilterCapabilities
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat)
throws Exception
determineOutputFormat in class weka.filters.SimpleFilterinputFormat - the input format to base the output format on
Exception - in case the determination goes wrong
protected weka.core.Instances process(weka.core.Instances instances)
throws Exception
process in class weka.filters.SimpleFilterinstances - the data to process
Exception - in case the processing goes wrongpublic String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.filters.Filterpublic static void main(String[] args)
args - arguments to the filter: use -h for help
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||