weka.filters
Class RSDiscretize

java.lang.Object
  |
  +--weka.filters.Filter
        |
        +--weka.filters.RSDiscretize
All Implemented Interfaces:
OptionHandler, Serializable

public class RSDiscretize
extends Filter
implements OptionHandler

See Also:
Serialized Form

Field Summary
protected  MDCutPoints bestCuts
           
protected  double[][] cutPoints
          Store the current cutpoints
 
Fields inherited from class weka.filters.Filter
m_Debug, m_NewBatch
 
Constructor Summary
RSDiscretize()
           
 
Method Summary
 boolean batchFinished()
          Signifies that this batch of input to the filter is finished.
protected  void calculateCutPoints()
           
protected  void convertInstance(Instance instance)
          Convert a single instance over.
 String debugTipText()
           
 int getDebug()
          Get the value of debug.
 boolean getGlobalDiscretization()
          Get the value of globalDiscretization.
 boolean getKeepValues()
          Get the value of keepValues.
 String[] getOptions()
          Gets the current settings of the filter.
 String globalDiscretizationTipText()
           
 String globalInfo()
          Returns a string describing this filter
 boolean input(Instance instance)
          Input an instance for filtering.
 String keepValuesTipText()
           
 Enumeration listOptions()
          Gets an enumeration describing the available options
static void main(String[] argv)
          Main method for testing this class.
 void setDebug(int v)
          Set the value of debug.
 void setGlobalDiscretization(boolean v)
          Set the value of globalDiscretization.
 boolean setInputFormat(Instances instanceInfo)
          Sets the format of the input instances.
 void setKeepValues(boolean v)
          Set the value of keepValues.
 void setOptions(String[] options)
          Sets the OptionHandler's options using the given list.
protected  void setOutputFormat()
          Set the output format.
 
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyStringValues, copyStringValues, filterFile, flushInput, getInputFormat, getInputStringIndex, getOutputFormat, getOutputStringIndex, getStringIndices, inputFormat, isOutputFormatDefined, numPendingOutput, output, outputFormat, outputFormatPeek, outputPeek, push, resetQueue, setOutputFormat, useFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cutPoints

protected double[][] cutPoints
Store the current cutpoints


bestCuts

protected MDCutPoints bestCuts
Constructor Detail

RSDiscretize

public RSDiscretize()
Method Detail

getDebug

public int getDebug()
Get the value of debug.

Returns:
value of debug.

setDebug

public void setDebug(int v)
Set the value of debug.

Parameters:
v - Value to assign to debug.

debugTipText

public String debugTipText()

getGlobalDiscretization

public boolean getGlobalDiscretization()
Get the value of globalDiscretization.

Returns:
value of globalDiscretization.

setGlobalDiscretization

public void setGlobalDiscretization(boolean v)
Set the value of globalDiscretization.

Parameters:
v - Value to assign to globalDiscretization.

globalDiscretizationTipText

public String globalDiscretizationTipText()

getKeepValues

public boolean getKeepValues()
Get the value of keepValues.

Returns:
value of keepValues.

setKeepValues

public void setKeepValues(boolean v)
Set the value of keepValues.

Parameters:
v - Value to assign to keepValues.

keepValuesTipText

public String keepValuesTipText()

calculateCutPoints

protected void calculateCutPoints()
                           throws Exception
Exception

listOptions

public Enumeration listOptions()
Gets an enumeration describing the available options

Specified by:
listOptions in interface OptionHandler
Returns:
an enumeration of all the available options

setOptions

public void setOptions(String[] options)
                throws Exception
Description copied from interface: OptionHandler
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).

Specified by:
setOptions in interface OptionHandler
Parameters:
options - the list of options as an array of strings
Throws:
Exception - if an option is not supported

getOptions

public String[] getOptions()
Gets the current settings of the filter.

Specified by:
getOptions in interface OptionHandler
Returns:
an array of strings suitable for passing to setOptions

input

public boolean input(Instance instance)
Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output.

Overrides:
input in class Filter
Parameters:
instance - the input instance
Returns:
true if the filtered instance may now be collected with output().
Throws:
IllegalStateException - if no input format has been defined.

setInputFormat

public boolean setInputFormat(Instances instanceInfo)
                       throws Exception
Sets the format of the input instances.

Overrides:
setInputFormat in class Filter
Parameters:
instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
Returns:
true if the outputFormat may be collected immediately
Throws:
Exception - if the input format can't be set successfully

batchFinished

public boolean batchFinished()
Signifies that this batch of input to the filter is finished. If the filter requires all instances prior to filtering, output() may now be called to retrieve the filtered instances.

Overrides:
batchFinished in class Filter
Returns:
true if there are instances pending output
Throws:
IllegalStateException - if no input structure has been defined

setOutputFormat

protected void setOutputFormat()
Set the output format. Takes the currently defined cutpoints and m_InputFormat and calls setOutputFormat(Instances) appropriately.


convertInstance

protected void convertInstance(Instance instance)
Convert a single instance over. The converted instance is added to the end of the output queue.

Parameters:
instance - the instance to convert

globalInfo

public String globalInfo()
Returns a string describing this filter

Returns:
a description of the filter suitable for displaying in the explorer/experimenter gui

main

public static void main(String[] argv)
Main method for testing this class.

Parameters:
argv - should contain arguments to the filter: use -h for help