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)
REPTree()
-
buildClassifier(Instances)
- Builds classifier.
distributionForInstance(Instance)
- Computes class distribution of an instance using the tree.
enumerateMeasures()
- Returns an enumeration of the additional measure names.
getMaxDepth()
- Get the value of MaxDepth.
getMeasure(String)
- Returns the value of the named measure.
getMinNum()
- Get the value of MinNum.
getMinVarianceProp()
- Get the value of MinVarianceProp.
getNoPruning()
- Get the value of NoPruning.
getNumFolds()
- Get the value of NumFolds.
getOptions()
- Gets options from this classifier.
getSeed()
- Get the value of Seed.
graph()
- Outputs the decision tree as a graph
listOptions()
- Lists the command-line options for this classifier.
main(String[])
- Main method for this class.
numNodes()
- Computes size of the tree.
setMaxDepth(int)
- Set the value of MaxDepth.
setMinNum(double)
- Set the value of MinNum.
setMinVarianceProp(double)
- Set the value of MinVarianceProp.
setNoPruning(boolean)
- Set the value of NoPruning.
setNumFolds(int)
- Set the value of NumFolds.
setOptions(String[])
- Parses a given list of options.
setSeed(int)
- Set the value of Seed.
toSource(String)
- Returns the tree as if-then statements.
toString()
- Outputs the decision tree.
REPTree
public REPTree()
getNoPruning
public boolean getNoPruning()
Get the value of NoPruning.
- Returns:
- Value of NoPruning.
setNoPruning
public void setNoPruning(boolean newNoPruning)
Set the value of NoPruning.
- Parameters:
newNoPruning - Value to assign to NoPruning.
getMinNum
public double getMinNum()
Get the value of MinNum.
- Returns:
- Value of MinNum.
setMinNum
public void setMinNum(double newMinNum)
Set the value of MinNum.
- Parameters:
newMinNum - Value to assign to MinNum.
getMinVarianceProp
public double getMinVarianceProp()
Get the value of MinVarianceProp.
- Returns:
- Value of MinVarianceProp.
setMinVarianceProp
public void setMinVarianceProp(double newMinVarianceProp)
Set the value of MinVarianceProp.
- Parameters:
newMinVarianceProp - Value to assign to MinVarianceProp.
getSeed
public int getSeed()
Get the value of Seed.
- Returns:
- Value of Seed.
setSeed
public void setSeed(int newSeed)
Set the value of Seed.
- Parameters:
newSeed - Value to assign to Seed.
getNumFolds
public int getNumFolds()
Get the value of NumFolds.
- Returns:
- Value of NumFolds.
setNumFolds
public void setNumFolds(int newNumFolds)
Set the value of NumFolds.
- Parameters:
newNumFolds - Value to assign to NumFolds.
getMaxDepth
public int getMaxDepth()
Get the value of MaxDepth.
- Returns:
- Value of MaxDepth.
setMaxDepth
public void setMaxDepth(int newMaxDepth)
Set the value of MaxDepth.
- Parameters:
newMaxDepth - Value to assign to MaxDepth.
listOptions
public java.util.Enumeration listOptions()
Lists the command-line options for this classifier.
getOptions
public java.lang.String[] getOptions()
Gets options from this classifier.
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
numNodes
public int numNodes()
Computes size of the tree.
enumerateMeasures
public java.util.Enumeration enumerateMeasures()
Returns an enumeration of the additional measure names.
- Returns:
- an enumeration of the measure names
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
buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
Builds classifier.
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
Computes class distribution of an instance using the tree.
- Overrides:
- distributionForInstance in class DistributionClassifier
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
graph
public java.lang.String graph() throws java.lang.Exception
Outputs the decision tree as a graph
toString
public java.lang.String toString()
Outputs the decision tree.
- Overrides:
- toString in class java.lang.Object
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