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

Class weka.classifiers.trees.REPTree

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.trees.REPTree

public class REPTree
extends DistributionClassifier
implements OptionHandler, WeightedInstancesHandler, Drawable, AdditionalMeasureProducer, Sourcable
Fast decision tree learner. Builds a decision/regression tree using information gain/variance and prunes it using reduced-error pruning. Only sorts values for numeric attributes once. Missing values are dealt with by splitting the corresponding instances into pieces (i.e. as in C4.5). Valid options are:

-M number
Set minimum number of instances per leaf (default 2).

-V number
Set minimum numeric class variance proportion of train variance for split (default 1e-3).

-N number
Number of folds for reduced error pruning (default 3).

-S number
Seed for random data shuffling (default 1).

-P
No pruning.

-D
Maximum tree depth (default -1, no maximum).

Version:
$Revision: 1.10 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

Constructor Index

 o REPTree()
 

Method Index

 o buildClassifier(Instances)
Builds classifier.
 o distributionForInstance(Instance)
Computes class distribution of an instance using the tree.
 o enumerateMeasures()
Returns an enumeration of the additional measure names.
 o getMaxDepth()
Get the value of MaxDepth.
 o getMeasure(String)
Returns the value of the named measure.
 o getMinNum()
Get the value of MinNum.
 o getMinVarianceProp()
Get the value of MinVarianceProp.
 o getNoPruning()
Get the value of NoPruning.
 o getNumFolds()
Get the value of NumFolds.
 o getOptions()
Gets options from this classifier.
 o getSeed()
Get the value of Seed.
 o graph()
Outputs the decision tree as a graph
 o listOptions()
Lists the command-line options for this classifier.
 o main(String[])
Main method for this class.
 o numNodes()
Computes size of the tree.
 o setMaxDepth(int)
Set the value of MaxDepth.
 o setMinNum(double)
Set the value of MinNum.
 o setMinVarianceProp(double)
Set the value of MinVarianceProp.
 o setNoPruning(boolean)
Set the value of NoPruning.
 o setNumFolds(int)
Set the value of NumFolds.
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set the value of Seed.
 o toSource(String)
Returns the tree as if-then statements.
 o toString()
Outputs the decision tree.

Constructor Detail

 o REPTree
public REPTree()

Method Detail

 o getNoPruning
public boolean getNoPruning()
          Get the value of NoPruning.
Returns:
Value of NoPruning.
 o setNoPruning
public void setNoPruning(boolean newNoPruning)
          Set the value of NoPruning.
Parameters:
newNoPruning - Value to assign to NoPruning.
 o getMinNum
public double getMinNum()
          Get the value of MinNum.
Returns:
Value of MinNum.
 o setMinNum
public void setMinNum(double newMinNum)
          Set the value of MinNum.
Parameters:
newMinNum - Value to assign to MinNum.
 o getMinVarianceProp
public double getMinVarianceProp()
          Get the value of MinVarianceProp.
Returns:
Value of MinVarianceProp.
 o setMinVarianceProp
public void setMinVarianceProp(double newMinVarianceProp)
          Set the value of MinVarianceProp.
Parameters:
newMinVarianceProp - Value to assign to MinVarianceProp.
 o getSeed
public int getSeed()
          Get the value of Seed.
Returns:
Value of Seed.
 o setSeed
public void setSeed(int newSeed)
          Set the value of Seed.
Parameters:
newSeed - Value to assign to Seed.
 o getNumFolds
public int getNumFolds()
          Get the value of NumFolds.
Returns:
Value of NumFolds.
 o setNumFolds
public void setNumFolds(int newNumFolds)
          Set the value of NumFolds.
Parameters:
newNumFolds - Value to assign to NumFolds.
 o getMaxDepth
public int getMaxDepth()
          Get the value of MaxDepth.
Returns:
Value of MaxDepth.
 o setMaxDepth
public void setMaxDepth(int newMaxDepth)
          Set the value of MaxDepth.
Parameters:
newMaxDepth - Value to assign to MaxDepth.
 o listOptions
public java.util.Enumeration listOptions()
          Lists the command-line options for this classifier.
 o getOptions
public java.lang.String[] getOptions()
          Gets options from this classifier.
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options.
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o numNodes
public int numNodes()
          Computes size of the tree.
 o enumerateMeasures
public java.util.Enumeration enumerateMeasures()
          Returns an enumeration of the additional measure names.
Returns:
an enumeration of the measure names
 o getMeasure
public double getMeasure(java.lang.String additionalMeasureName)
          Returns the value of the named measure.
Parameters:
measureName - the name of the measure to query for its value
Returns:
the value of the named measure
Throws:
java.lang.IllegalArgumentException - if the named measure is not supported
 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Builds classifier.
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
          Computes class distribution of an instance using the tree.
Overrides:
distributionForInstance in class DistributionClassifier
 o toSource
public java.lang.String toSource(java.lang.String className) throws java.lang.Exception
          Returns the tree as if-then statements.
Returns:
the tree as a Java if-then type statement
Throws:
java.lang.Exception - if something goes wrong
 o graph
public java.lang.String graph() throws java.lang.Exception
          Outputs the decision tree as a graph
 o toString
public java.lang.String toString()
          Outputs the decision tree.
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String argv[])
          Main method for this class.

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