net.sf.bddbddb.order
Class MyDiscretize

java.lang.Object
  extended by weka.filters.Filter
      extended by weka.filters.unsupervised.attribute.PotentialClassIgnorer
          extended by weka.filters.unsupervised.attribute.Discretize
              extended by net.sf.bddbddb.order.MyDiscretize
All Implemented Interfaces:
java.io.Serializable, weka.core.OptionHandler, weka.core.WeightedInstancesHandler, weka.filters.UnsupervisedFilter

public class MyDiscretize
extends weka.filters.unsupervised.attribute.Discretize

Discretizes numeric attributes using equal frequency binning where the number of bins is equal to the square root of the number of non-missing values.

Valid filter-specific options are:

-R col1,col2-col4,...
Specifies list of columns to Discretize. First and last are valid indexes. (default: first-last)

-V
Invert matching sense.

-D
Make binary nominal attributes.

Version:
$Revision: 531 $
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.filters.unsupervised.attribute.Discretize
m_CutPoints, m_DefaultCols, m_DesiredWeightOfInstancesPerInterval, m_DiscretizeCols, m_FindNumBins, m_MakeBinary, m_NumBins, m_UseEqualFrequency
 
Fields inherited from class weka.filters.unsupervised.attribute.PotentialClassIgnorer
m_ClassIndex, m_IgnoreClass
 
Fields inherited from class weka.filters.Filter
m_NewBatch
 
Constructor Summary
MyDiscretize()
           
MyDiscretize(double p)
           
 
Method Summary
 java.lang.String binsTipText()
          Returns the tip text for this property
protected  void findNumBins(int index)
          Finds the number of bins to use and creates the cut points.
 java.lang.String findNumBinsTipText()
          Returns the tip text for this property
 int getBins()
          Ignored
 boolean getFindNumBins()
          Get the value of FindNumBins.
 java.lang.String[] getOptions()
          Gets the current settings of the filter.
 boolean getUseEqualFrequency()
          Get the value of UseEqualFrequency.
 java.lang.String globalInfo()
          Returns a string describing this filter
 java.util.Enumeration listOptions()
          Gets an enumeration describing the available options.
static void main(java.lang.String[] argv)
          Main method for testing this class.
 void setBins(int numBins)
          Ignored
 void setFindNumBins(boolean newFindNumBins)
          Set the value of FindNumBins.
 boolean setInputFormat(weka.core.Instances instanceInfo)
          Sets the format of the input instances.
 void setOptions(java.lang.String[] options)
          Parses the options for this object.
 void setUseEqualFrequency(boolean newUseEqualFrequency)
          Set the value of UseEqualFrequency.
 java.lang.String useEqualFrequencyTipText()
          Returns the tip text for this property
 
Methods inherited from class weka.filters.unsupervised.attribute.Discretize
attributeIndicesTipText, batchFinished, calculateCutPoints, calculateCutPointsByEqualFrequencyBinning, calculateCutPointsByEqualWidthBinning, convertInstance, desiredWeightOfInstancesPerIntervalTipText, getAttributeIndices, getCutPoints, getDesiredWeightOfInstancesPerInterval, getInvertSelection, getMakeBinary, input, invertSelectionTipText, makeBinaryTipText, setAttributeIndices, setAttributeIndicesArray, setDesiredWeightOfInstancesPerInterval, setInvertSelection, setMakeBinary, setOutputFormat
 
Methods inherited from class weka.filters.unsupervised.attribute.PotentialClassIgnorer
getOutputFormat, setIgnoreClass
 
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyStringValues, copyStringValues, filterFile, flushInput, getInputFormat, getInputStringIndex, getOutputStringIndex, getStringIndices, inputFormat, inputFormatPeek, 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

MyDiscretize

public MyDiscretize()

MyDiscretize

public MyDiscretize(double p)
Method Detail

setInputFormat

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

Overrides:
setInputFormat in class weka.filters.unsupervised.attribute.Discretize
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:
java.lang.Exception - if the input format can't be set successfully

findNumBins

protected void findNumBins(int index)
Finds the number of bins to use and creates the cut points.

Overrides:
findNumBins in class weka.filters.unsupervised.attribute.Discretize
Parameters:
index - the attribute index

listOptions

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

Specified by:
listOptions in interface weka.core.OptionHandler
Overrides:
listOptions in class weka.filters.unsupervised.attribute.Discretize
Returns:
an enumeration of all the available options.

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses the options for this object. Valid options are:

-R col1,col2-col4,...
Specifies list of columns to Discretize. First and last are valid indexes. (default none)

-V
Invert matching sense.

-D
Make binary nominal attributes.

Specified by:
setOptions in interface weka.core.OptionHandler
Overrides:
setOptions in class weka.filters.unsupervised.attribute.Discretize
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported

getOptions

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

Specified by:
getOptions in interface weka.core.OptionHandler
Overrides:
getOptions in class weka.filters.unsupervised.attribute.Discretize
Returns:
an array of strings suitable for passing to setOptions

globalInfo

public java.lang.String globalInfo()
Returns a string describing this filter

Overrides:
globalInfo in class weka.filters.unsupervised.attribute.Discretize
Returns:
a description of the filter suitable for displaying in the explorer/experimenter gui

findNumBinsTipText

public java.lang.String findNumBinsTipText()
Returns the tip text for this property

Overrides:
findNumBinsTipText in class weka.filters.unsupervised.attribute.Discretize
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getFindNumBins

public boolean getFindNumBins()
Get the value of FindNumBins.

Overrides:
getFindNumBins in class weka.filters.unsupervised.attribute.Discretize
Returns:
Value of FindNumBins.

setFindNumBins

public void setFindNumBins(boolean newFindNumBins)
Set the value of FindNumBins.

Overrides:
setFindNumBins in class weka.filters.unsupervised.attribute.Discretize
Parameters:
newFindNumBins - Value to assign to FindNumBins.

useEqualFrequencyTipText

public java.lang.String useEqualFrequencyTipText()
Returns the tip text for this property

Overrides:
useEqualFrequencyTipText in class weka.filters.unsupervised.attribute.Discretize
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getUseEqualFrequency

public boolean getUseEqualFrequency()
Get the value of UseEqualFrequency.

Overrides:
getUseEqualFrequency in class weka.filters.unsupervised.attribute.Discretize
Returns:
Value of UseEqualFrequency.

setUseEqualFrequency

public void setUseEqualFrequency(boolean newUseEqualFrequency)
Set the value of UseEqualFrequency.

Overrides:
setUseEqualFrequency in class weka.filters.unsupervised.attribute.Discretize
Parameters:
newUseEqualFrequency - Value to assign to UseEqualFrequency.

binsTipText

public java.lang.String binsTipText()
Returns the tip text for this property

Overrides:
binsTipText in class weka.filters.unsupervised.attribute.Discretize
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getBins

public int getBins()
Ignored

Overrides:
getBins in class weka.filters.unsupervised.attribute.Discretize
Returns:
the number of bins.

setBins

public void setBins(int numBins)
Ignored

Overrides:
setBins in class weka.filters.unsupervised.attribute.Discretize
Parameters:
numBins - the number of bins

main

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

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


Copyright © 2004-2008 Stanford SUIF Compiler Group. All Rights Reserved.