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

Class weka.classifiers.trees.RandomTree

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

public class RandomTree
extends DistributionClassifier
implements OptionHandler, WeightedInstancesHandler, Randomizable
Class for constructing a tree that considers K random features at each node. Performs no pruning.

Version:
$Revision: 1.1 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)

Constructor Index

 o RandomTree()
 

Method Index

 o buildClassifier(Instances)
Builds classifier.
 o distributionForInstance(Instance)
Computes class distribution of an instance using the decision tree.
 o getDebug()
Get the value of Debug.
 o getKValue()
Get the value of K.
 o getMinNum()
Get the value of MinNum.
 o getOptions()
Gets options from this classifier.
 o getSeed()
Gets the seed for the random number generations
 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 setDebug(boolean)
Set the value of Debug.
 o setKValue(int)
Set the value of K.
 o setMinNum(double)
Set the value of MinNum.
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set the seed for random number generation.
 o toGraph()
Outputs the decision tree as a graph
 o toGraph(StringBuffer, int)
Outputs one node for graph.
 o toString()
Outputs the decision tree.

Constructor Detail

 o RandomTree
public RandomTree()

Method Detail

 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 getKValue
public int getKValue()
          Get the value of K.
Returns:
Value of K.
 o setKValue
public void setKValue(int k)
          Set the value of K.
Parameters:
k - Value to assign to K.
 o getDebug
public boolean getDebug()
          Get the value of Debug.
Returns:
Value of Debug.
 o setDebug
public void setDebug(boolean newDebug)
          Set the value of Debug.
Parameters:
newDebug - Value to assign to Debug.
 o setSeed
public void setSeed(int seed)
          Set the seed for random number generation.
Parameters:
seed - the seed
 o getSeed
public int getSeed()
          Gets the seed for the random number generations
Returns:
the seed for the random number generation
 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 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 decision tree.
Overrides:
distributionForInstance in class DistributionClassifier
 o toGraph
public java.lang.String toGraph()
          Outputs the decision tree as a graph
 o toGraph
public int toGraph(java.lang.StringBuffer text,
                   int num) throws java.lang.Exception
          Outputs one node for graph.
 o toString
public java.lang.String toString()
          Outputs the decision tree.
Overrides:
toString in class java.lang.Object
 o numNodes
public int numNodes()
          Computes size of the tree.
 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