Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weka.classifiers.meta
Class RegressionByDiscretization

    java.lang.Object
      weka.classifiers.Classifier
          weka.classifiers.SingleClassifierEnhancer
              weka.classifiers.meta.RegressionByDiscretization

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, OptionHandler

    public class RegressionByDiscretization

extends SingleClassifierEnhancer

Class for a regression scheme that employs any distribution classifier on a copy of the data that has the class attribute (equal-width) discretized. The predicted value is the expected value of the mean class value for each discretized interval (based on the predicted probabilities for each interval).

Valid options are:

-D
Produce debugging output.

-B
Number of bins for equal-width discretization (default 10).

Version:
  $Revision: 1.30 $
Author:
  Len Trigg (trigg@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
  Serialized Form

Constructor Summary
`RegressionByDiscretization()` Default constructor.

Method Summary
`void` | `buildClassifier(Instances instances)` Generates the classifier.
`double` | `classifyInstance(Instance instance)` Returns a predicted class for the test instance.
`int` | `getNumBins()` Gets the number of bins numeric attributes will be divided into
`java.lang.String[]` | `getOptions()` Gets the current settings of the Classifier.
`java.lang.String` | `globalInfo()` Returns a string describing classifier
`java.util.Enumeration` | `listOptions()` Returns an enumeration describing the available options.
`static void` | `main(java.lang.String[] argv)` Main method for testing this class.
`java.lang.String` | `numBinsTipText()` Returns the tip text for this property
`void` | `setNumBins(int numBins)` Sets the number of bins to divide each selected numeric attribute into
`void` | `setOptions(java.lang.String[] options)` Parses a given list of options.
`java.lang.String` | `toString()` Returns a description of the classifier.

Methods inherited from class weka.classifiers.SingleClassifierEnhancer
`classifierTipText, getClassifier, setClassifier`

Methods inherited from class weka.classifiers.Classifier
`debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### RegressionByDiscretization

    public RegressionByDiscretization()

  Default constructor.

Method Detail

### globalInfo

    public java.lang.String globalInfo()

  Returns a string describing classifier

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

### buildClassifier

    public void buildClassifier(Instances instances)
                         throws java.lang.Exception

  Generates the classifier.

  Specified by:
    `buildClassifier` in class `Classifier`
  Parameters:
    `instances` - set of instances serving as training data
  Throws:
    `java.lang.Exception` - if the classifier has not been generated successfully

### classifyInstance

    public double classifyInstance(Instance instance)
                            throws java.lang.Exception

  Returns a predicted class for the test instance.

  Overrides:
    `classifyInstance` in class `Classifier`
  Parameters:
    `instance` - the instance to be classified
  Returns:
    predicted class value
  Throws:
    `java.lang.Exception` - if the prediction couldn't be made

### listOptions

    public java.util.Enumeration listOptions()

  Returns an enumeration describing the available options.

  Specified by:
    `listOptions` in interface `OptionHandler`
  Overrides:
    `listOptions` in class `SingleClassifierEnhancer`
  Returns:
    an enumeration of all the available options.

### setOptions

    public void setOptions(java.lang.String[] options)
                    throws java.lang.Exception

  Parses a given list of options. Valid options are:

  -D
  Produce debugging output.

  -W classifierstring
  Classifierstring should contain the full class name of a classifier followed by options to the classifier (default: weka.classifiers.rules.ZeroR).

  -B
  Number of bins for equal-width discretization (default 10).

  Specified by:
    `setOptions` in interface `OptionHandler`
  Overrides:
    `setOptions` in class `SingleClassifierEnhancer`
  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 Classifier.

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

### numBinsTipText

    public java.lang.String numBinsTipText()

  Returns the tip text for this property

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

### getNumBins

    public int getNumBins()

  Gets the number of bins numeric attributes will be divided into

  Returns:
    the number of bins.

### setNumBins

    public void setNumBins(int numBins)

  Sets the number of bins to divide each selected numeric attribute into

  Parameters:
    `numBins` - the number of bins

### toString

    public java.lang.String toString()

  Returns a description of the classifier.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    a description of the classifier as a string.

### main

    public static void main(java.lang.String[] argv)

  Main method for testing this class.

  Parameters:
    `argv` - the options

Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD