All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.m5.M5Prime

java.lang.Object
   |
   +----weka.classifiers.Classifier
           |
           +----weka.classifiers.m5.M5Prime

public final class M5Prime
extends Classifier
implements OptionHandler
Class for contructing and evaluating model trees; M5' algorithm.

Reference: 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:

-O
Type of model to be used. (l: linear regression, r: regression tree, m: model tree) (default: m)

-U
Use unsmoothed tree.

-F factor
Set pruning factor (default: 2).

-V <0|1|2>
Verbosity (default: 0).

Version:
$Revision: 1.7 $
Author:
Yong Wang (yongwang@cs.waikato.ac.nz)

Variable Index

 o MODEL_LINEAR_REGRESSION
 o MODEL_MODEL_TREE
 o MODEL_REGRESSION_TREE
 o TAGS_MODEL_TYPES

Constructor Index

 o M5Prime()

Method Index

 o buildClassifier(Instances)
Construct a model tree by training instances
 o classifyInstance(Instance)
Classifies the given test instance.
 o getModelType()
Get the value of Model.
 o getOptions()
Gets the current settings of the Classifier.
 o getPruningFactor()
Get the value of PruningFactor.
 o getUseUnsmoothed()
Get the value of UseUnsmoothed.
 o getVerbosity()
Get the value of Verbosity.
 o listOptions()
Returns an enumeration describing the available options.
 o main(String[])
Main method for M5' algorithm
 o setModelType(SelectedTag)
Set the value of Model.
 o setOptions(String[])
Parses a given list of options.
 o setPruningFactor(double)
Set the value of PruningFactor.
 o setUseUnsmoothed(boolean)
Set the value of UseUnsmoothed.
 o setVerbosity(int)
Set the value of Verbosity.
 o toString()
Converts the output of the training process into a string

Variables

 o MODEL_LINEAR_REGRESSION
 public static final int MODEL_LINEAR_REGRESSION
 o MODEL_REGRESSION_TREE
 public static final int MODEL_REGRESSION_TREE
 o MODEL_MODEL_TREE
 public static final int MODEL_MODEL_TREE
 o TAGS_MODEL_TYPES
 public static final Tag TAGS_MODEL_TYPES[]

Constructors

 o M5Prime
 public M5Prime()

Methods

 o buildClassifier
 public final void buildClassifier(Instances inst) throws Exception
Construct a model tree by training instances

Parameters:
inst - training instances
options - information for constructing the model tree, mostly from command line options
Returns:
the root of the model tree
Throws: Exception
if the classifier can't be built
Overrides:
buildClassifier in class Classifier
 o classifyInstance
 public double classifyInstance(Instance ins) throws Exception
Classifies the given test instance.

Parameters:
instance - the instance to be classified
Returns:
the predicted class for the instance
Throws: Exception
if the instance can't be classified
Overrides:
classifyInstance in class Classifier
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options. Valid options are:

-O
Type of model to be used. (l: linear regression, r: regression tree, m: model tree) (default: m)

-U
Use unsmoothed tree.

-F factor
Set pruning factor (default: 2).

-V <0|1|2>
Verbosity (default: 0).

Returns:
an enumeration of all the available options
 o setOptions
 public void setOptions(String options[]) throws Exception
Parses a given list of options.

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o getOptions
 public String[] getOptions()
Gets the current settings of the Classifier.

Returns:
an array of strings suitable for passing to setOptions
 o toString
 public final String toString()
Converts the output of the training process into a string

Returns:
the converted string
Overrides:
toString in class Object
 o getUseUnsmoothed
 public boolean getUseUnsmoothed()
Get the value of UseUnsmoothed.

Returns:
Value of UseUnsmoothed.
 o setUseUnsmoothed
 public void setUseUnsmoothed(boolean v)
Set the value of UseUnsmoothed.

Parameters:
v - Value to assign to UseUnsmoothed.
 o getPruningFactor
 public double getPruningFactor()
Get the value of PruningFactor.

Returns:
Value of PruningFactor.
 o setPruningFactor
 public void setPruningFactor(double v)
Set the value of PruningFactor.

Parameters:
v - Value to assign to PruningFactor.
 o getModelType
 public SelectedTag getModelType()
Get the value of Model.

Returns:
Value of Model.
 o setModelType
 public void setModelType(SelectedTag newMethod)
Set the value of Model.

Parameters:
v - Value to assign to Model.
 o getVerbosity
 public int getVerbosity()
Get the value of Verbosity.

Returns:
Value of Verbosity.
 o setVerbosity
 public void setVerbosity(int v)
Set the value of Verbosity.

Parameters:
v - Value to assign to Verbosity.
 o main
 public static void main(String argv[])
Main method for M5' algorithm

Parameters:
argv - command line arguments

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home