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

Class weka.classifiers.trees.m5.Rule

java.lang.Object
    |
    +----weka.classifiers.trees.m5.Rule

public class Rule
extends java.lang.Object
Generates a single m5 tree or rule

Version:
$Revision: 1.5 $
Author:
Mark Hall

Constructor Index

 o Rule()
Constructor declaration

Method Index

 o buildClassifier(Instances)
Generates a single rule or m5 model tree.
 o classifyInstance(Instance)
Calculates a prediction for an instance using this rule or M5 model tree
 o getMinNumInstances()
Get the minimum number of instances to allow at a leaf node
 o getRegressionTree()
Get the value of regressionTree.
 o getSmoothing()
Get whether or not smoothing has been turned on
 o getUnpruned()
Get whether unpruned tree/rules are being generated
 o getUseTree()
get whether an m5 tree is being used rather than rules
 o notCoveredInstances()
Get the instances not covered by this rule
 o setMinNumInstances(double)
Set the minumum number of instances to allow at a leaf node
 o setRegressionTree(boolean)
Set the value of regressionTree.
 o setSmoothing(boolean)
Smooth predictions
 o setUnpruned(boolean)
Use unpruned tree/rules
 o setUseTree(boolean)
Use an m5 tree rather than generate rules
 o toString()
Return a description of the m5 tree or rule

Constructor Detail

 o Rule
public Rule()
          Constructor declaration

Method Detail

 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Generates a single rule or m5 model tree.
Parameters:
data - set of instances serving as training data
Throws:
java.lang.Exception - if the rule has not been generated successfully
 o classifyInstance
public double classifyInstance(Instance instance) throws java.lang.Exception
          Calculates a prediction for an instance using this rule or M5 model tree
Parameters:
inst - the instance whos class value is to be predicted
Returns:
the prediction
Throws:
if - a prediction can't be made.
 o toString
public java.lang.String toString()
          Return a description of the m5 tree or rule
Returns:
a description of the m5 tree or rule as a String
Overrides:
toString in class java.lang.Object
 o setUnpruned
public void setUnpruned(boolean unpruned)
          Use unpruned tree/rules
Parameters:
unpruned - true if unpruned tree/rules are to be generated
 o getUnpruned
public boolean getUnpruned()
          Get whether unpruned tree/rules are being generated
Returns:
true if unpruned tree/rules are to be generated
 o setUseTree
public void setUseTree(boolean u)
          Use an m5 tree rather than generate rules
Parameters:
u - true if m5 tree is to be used
 o getUseTree
public boolean getUseTree()
          get whether an m5 tree is being used rather than rules
Returns:
true if an m5 tree is being used.
 o setSmoothing
public void setSmoothing(boolean s)
          Smooth predictions
Parameters:
s - true if smoothing is to be used
 o getSmoothing
public boolean getSmoothing()
          Get whether or not smoothing has been turned on
Returns:
true if smoothing is being used
 o notCoveredInstances
public Instances notCoveredInstances()
          Get the instances not covered by this rule
Returns:
the instances not covered
 o getRegressionTree
public boolean getRegressionTree()
          Get the value of regressionTree.
Returns:
Value of regressionTree.
 o setRegressionTree
public void setRegressionTree(boolean newregressionTree)
          Set the value of regressionTree.
Parameters:
newregressionTree - Value to assign to regressionTree.
 o setMinNumInstances
public void setMinNumInstances(double minNum)
          Set the minumum number of instances to allow at a leaf node
Parameters:
minNum - the minimum number of instances
 o getMinNumInstances
public double getMinNumInstances()
          Get the minimum number of instances to allow at a leaf node
Returns:
a double value

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