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.trees
Class M5P

    java.lang.Object
      weka.classifiers.Classifier
          weka.classifiers.trees.m5.M5Base
              weka.classifiers.trees.M5P

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

    public class M5P

extends M5Base
implements Drawable

M5P. Implements routines for generating M5 model trees.

The original algorithm M5 was invented by Quinlan:
Quinlan J. R. (1992). Learning with continuous classes. Proceedings of the Australian Joint Conference on Artificial Intelligence. 343--348. World Scientific, Singapore.

Yong Wang made improvements and created M5':
Wang, Y and Witten, I. H. (1997). Induction of model trees for predicting continuous classes. Proceedings of the poster papers of the European Conference on Machine Learning. University of Economics, Faculty of Informatics and Statistics, Prague.

Valid options are:

-U
Use unsmoothed predictions.

Version:
  $Revision: 1.1.2.1 $
Author:
  Mark Hall
See Also:
  Serialized Form

Field Summary

Fields inherited from interface weka.core.Drawable
`BayesNet, NOT_DRAWABLE, TREE`

Constructor Summary
`M5P()` Creates a new `M5P` instance.

Method Summary
`java.lang.String[]` | `getOptions()` Gets the current settings of the classifier.
`boolean` | `getSaveInstances()` Get whether instance data is being save.
`java.lang.String` | `graph()` Return a dot style String describing the tree.
`int` | `graphType()` Returns the type of graph this classifier represents.
`java.util.Enumeration` | `listOptions()` Returns an enumeration describing the available options
`static void` | `main(java.lang.String[] args)` Main method by which this class can be tested
`void` | `setOptions(java.lang.String[] options)` Parses a given list of options.
`void` | `setSaveInstances(boolean save)` Set whether to save instance data at each node in the tree for visualization purposes

Methods inherited from class weka.classifiers.trees.m5.M5Base
`buildClassifier, classifyInstance, enumerateMeasures, getBuildRegressionTree, getM5RootNode, getMeasure, getMinNumInstances, getUnpruned, getUseUnsmoothed, globalInfo, measureNumRules, setBuildRegressionTree, setMinNumInstances, setUnpruned, setUseUnsmoothed, toString`

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

### M5P

    public M5P()

  Creates a new `M5P` instance.

Method Detail

### graphType

    public int graphType()

  Returns the type of graph this classifier represents.

  Specified by:
    `graphType` in interface `Drawable`
  Returns:
    Drawable.TREE

### graph

    public java.lang.String graph()
                           throws java.lang.Exception

  Return a dot style String describing the tree.

  Specified by:
    `graph` in interface `Drawable`
  Returns:
    a `String` value
  Throws:
    `java.lang.Exception` - if an error occurs

### setSaveInstances

    public void setSaveInstances(boolean save)

  Set whether to save instance data at each node in the tree for visualization purposes

  Parameters:
    `save` - a `boolean` value

### getSaveInstances

    public boolean getSaveInstances()

  Get whether instance data is being save.

  Returns:
    a `boolean` value

### listOptions

    public java.util.Enumeration listOptions()

  Returns an enumeration describing the available options

  Specified by:
    `listOptions` in interface `OptionHandler`
  Overrides:
    `listOptions` in class `M5Base`
  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:

  -U
  Use unsmoothed predictions.

  -R
  Build a regression tree rather than a model tree.

  -L
  Save instance data at each node (for visualization purposes).

  Specified by:
    `setOptions` in interface `OptionHandler`
  Overrides:
    `setOptions` in class `M5Base`
  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 `M5Base`
  Returns:
    an array of strings suitable for passing to setOptions

### main

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

  Main method by which this class can be tested

  Parameters:
    `args` - an array of 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