weka.filters
Class RSNumerizeNominal

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

public class RSNumerizeNominal
extends Filter
implements OptionHandler

Creates numerical attributes of nominal ones, in case we wish to discretize them also

Version:
$Revision: 1.1 $
Author:
Ola Leifler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.filters.Filter
m_Debug, m_NewBatch
 
Constructor Summary
RSNumerizeNominal()
           
 
Method Summary
 String attributeIndicesTipText()
          Returns the tip text for this property
 String debugTipText()
           
 String getAttributeIndices()
          Gets the current range selection
 int getDebug()
          Get the value of debug.
 String[] getOptions()
          Gets the current option settings for the OptionHandler.
 String globalInfo()
          Returns a string describing this filter
 boolean input(Instance instance)
          Input an instance for filtering.
 Enumeration listOptions()
          Gets an enumeration describing the available options
static void main(String[] argv)
          Main method for testing this class.
 void setAttributeIndices(String rangeList)
          Sets which attributes are to be Discretized (only numeric attributes among the selection will be Discretized).
 void setDebug(int v)
          Set the value of debug.
 boolean setInputFormat(Instances instanceInfo)
          Sets the format of the input instances.
 void setOptions(String[] options)
          Sets the OptionHandler's options using the given list.
protected  void setOutputFormat()
           
 
Methods inherited from class weka.filters.Filter
batchFilterFile, batchFinished, 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
 

Constructor Detail

RSNumerizeNominal

public RSNumerizeNominal()
Method Detail

getOptions

public String[] getOptions()
Description copied from interface: OptionHandler
Gets the current option settings for the OptionHandler.

Specified by:
getOptions in interface OptionHandler
Returns:
the list of current option settings as an array of strings

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()

attributeIndicesTipText

public String attributeIndicesTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getAttributeIndices

public String getAttributeIndices()
Gets the current range selection

Returns:
a string containing a comma separated list of ranges

setAttributeIndices

public void setAttributeIndices(String rangeList)
Sets which attributes are to be Discretized (only numeric attributes among the selection will be Discretized).

Parameters:
rangeList - a string representing the list of attributes. Since the string will typically come from a user, attributes are indexed from 1.
eg: first-3,5,6-last
Throws:
IllegalArgumentException - if an invalid range list is supplied

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

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 inputFormat can't be set successfully

setOutputFormat

protected void setOutputFormat()
                        throws Exception
Exception

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.

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