public class ClassBalancer extends SimpleBatchFilter implements SupervisedFilter, WeightedInstancesHandler, WeightedAttributesHandler
-num-intervals <positive integer> The number of discretization intervals to use when the class is numeric (default of weka.attribute.unsupervised.Discretize).
-output-debug-info If set, filter is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, filter capabilities are not checked when input format is set (use with caution).
| Modifier and Type | Field and Description |
|---|---|
protected int |
m_NumIntervals
number of discretization intervals to use if the class is numeric
|
m_Debug, m_DoNotCheckCapabilities, m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts| Constructor and Description |
|---|
ClassBalancer() |
| 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.
|
int |
getNumIntervals()
Gets the number of discretization intervals to use when the class is numeric.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this filter.
|
static void |
main(java.lang.String[] args)
runs the filter with the given arguments
|
protected Instances |
process(Instances instances)
Processes the given data.
|
void |
setNumIntervals(int num)
Sets the number of discretization intervals to use.
|
allowAccessToFullInputFormat, batchFinished, hasImmediateOutputFormat, inputreset, setInputFormatbatchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, getOptions, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, listOptions, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOptions, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapperprotected int m_NumIntervals
@OptionMetadata(displayName="Number of discretization intervals", description="The number of discretization intervals to use when the class is numeric.", displayOrder=1, commandLineParamName="num-intervals", commandLineParamSynopsis="-num-intervals <int>", commandLineParamIsFlag=false) public int getNumIntervals()
public void setNumIntervals(int num)
num - the number of discretization intervals to use.public java.lang.String globalInfo()
globalInfo in class SimpleFilterprotected Instances determineOutputFormat(Instances inputFormat)
determineOutputFormat in class SimpleFilterinputFormat - the input format to base the output format onSimpleFilter.hasImmediateOutputFormat(),
Filter.batchFinished()public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiesprotected Instances process(Instances instances) throws java.lang.Exception
process in class SimpleFilterinstances - the data to processjava.lang.Exception - in case the processing goes wrongFilter.batchFinished()public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] args)
args - the commandline arguments