|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.trees.RandomForest
Class for constructing random forests. For more information see:
Leo Breiman. Random Forests. Machine Learning 45 (1):5-32, October 2001.
Valid options are:
-I num
Set the number of trees in the forest
(default 10)
-K num
Set the number of features to consider.
If < 1 (the default) will use logM+1, where M is the number of inputs.
-S seed
Random number seed (default 1).
| Constructor Summary | |
RandomForest()
|
|
| Method Summary | |
void |
buildClassifier(Instances data)
Builds a classifier for a set of instances. |
double[] |
distributionForInstance(Instance instance)
Returns the class probability distribution for an instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names. |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure. |
int |
getNumFeatures()
Get the number of features used in random selection. |
int |
getNumTrees()
Get the value of numTrees. |
java.lang.String[] |
getOptions()
Gets the current settings of the forest. |
int |
getSeed()
Gets the seed for the random number generations |
java.lang.String |
globalInfo()
Returns a string describing classifier |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for this class. |
double |
measureOutOfBagError()
Gets the out of bag error that was calculated as the classifier was built. |
java.lang.String |
numFeaturesTipText()
Returns the tip text for this property |
java.lang.String |
numTreesTipText()
Returns the tip text for this property |
java.lang.String |
seedTipText()
Returns the tip text for this property |
void |
setNumFeatures(int newNumFeatures)
Set the number of features to use in random selection. |
void |
setNumTrees(int newNumTrees)
Set the value of numTrees. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSeed(int seed)
Set the seed for random number generation. |
java.lang.String |
toString()
Outputs a description of this classifier. |
| Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RandomForest()
| Method Detail |
public java.lang.String globalInfo()
public java.lang.String numTreesTipText()
public int getNumTrees()
public void setNumTrees(int newNumTrees)
newNumTrees - Value to assign to numTrees.public java.lang.String numFeaturesTipText()
public int getNumFeatures()
public void setNumFeatures(int newNumFeatures)
newNumFeatures - Value to assign to numFeatures.public java.lang.String seedTipText()
public void setSeed(int seed)
setSeed in interface Randomizableseed - the seedpublic int getSeed()
getSeed in interface Randomizablepublic double measureOutOfBagError()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures in interface AdditionalMeasureProducerpublic double getMeasure(java.lang.String additionalMeasureName)
getMeasure in interface AdditionalMeasureProduceradditionalMeasureName - the name of the measure to query for its value
java.lang.IllegalArgumentException - if the named measure is not supportedpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifierpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifier
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface OptionHandlersetOptions in class Classifieroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supported
public void buildClassifier(Instances data)
throws java.lang.Exception
buildClassifier in class Classifierdata - set of instances serving as training data
java.lang.Exception - if something goes wrong
public double[] distributionForInstance(Instance instance)
throws java.lang.Exception
distributionForInstance in class Classifierinstance - the instance to be classified
java.lang.Exception - if distribution could not be
computed successfullypublic java.lang.String toString()
public static void main(java.lang.String[] argv)
argv - the options
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||