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)
RandomTree()
-
buildClassifier(Instances)
- Builds classifier.
distributionForInstance(Instance)
- Computes class distribution of an instance using the decision tree.
getDebug()
- Get the value of Debug.
getKValue()
- Get the value of K.
getMinNum()
- Get the value of MinNum.
getOptions()
- Gets options from this classifier.
getSeed()
- Gets the seed for the random number generations
listOptions()
- Lists the command-line options for this classifier.
main(String[])
- Main method for this class.
numNodes()
- Computes size of the tree.
setDebug(boolean)
- Set the value of Debug.
setKValue(int)
- Set the value of K.
setMinNum(double)
- Set the value of MinNum.
setOptions(String[])
- Parses a given list of options.
setSeed(int)
- Set the seed for random number generation.
toGraph()
- Outputs the decision tree as a graph
toGraph(StringBuffer, int)
- Outputs one node for graph.
toString()
- Outputs the decision tree.
RandomTree
public RandomTree()
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.
getKValue
public int getKValue()
Get the value of K.
- Returns:
- Value of K.
setKValue
public void setKValue(int k)
Set the value of K.
- Parameters:
k - Value to assign to K.
getDebug
public boolean getDebug()
Get the value of Debug.
- Returns:
- Value of Debug.
setDebug
public void setDebug(boolean newDebug)
Set the value of Debug.
- Parameters:
newDebug - Value to assign to Debug.
setSeed
public void setSeed(int seed)
Set the seed for random number generation.
- Parameters:
seed - the seed
getSeed
public int getSeed()
Gets the seed for the random number generations
- Returns:
- the seed for the random number generation
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
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 decision tree.
- Overrides:
- distributionForInstance in class DistributionClassifier
toGraph
public java.lang.String toGraph()
Outputs the decision tree as a graph
toGraph
public int toGraph(java.lang.StringBuffer text,
int num) throws java.lang.Exception
Outputs one node for graph.
toString
public java.lang.String toString()
Outputs the decision tree.
- Overrides:
- toString in class java.lang.Object
numNodes
public int numNodes()
Computes size of the tree.
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