net.sf.javaml.classification.tree
Class RandomForest

java.lang.Object
  extended by net.sf.javaml.classification.tree.RandomForest
All Implemented Interfaces:
java.io.Serializable, Classifier

public class RandomForest
extends java.lang.Object
implements Classifier

See Also:
Serialized Form

Constructor Summary
RandomForest(int treeCount)
           
RandomForest(int treeCount, boolean calculateOutOfBagErrorEstimate, int numAttributes, java.util.Random rg)
           
 
Method Summary
 void buildClassifier(Dataset data)
          Create a classifier from the given data set.
 java.util.Map<java.lang.Object,java.lang.Double> classDistribution(Instance instance)
          Generate the membership distribution for this instance using this classifier.
 java.lang.Object classify(Instance instance)
          Classify the instance according to this classifier.
 PerformanceMeasure getOutOfBagErrorEstimate()
           
 void setNumAttributes(int k)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomForest

public RandomForest(int treeCount)

RandomForest

public RandomForest(int treeCount,
                    boolean calculateOutOfBagErrorEstimate,
                    int numAttributes,
                    java.util.Random rg)
Method Detail

setNumAttributes

public void setNumAttributes(int k)

getOutOfBagErrorEstimate

public PerformanceMeasure getOutOfBagErrorEstimate()

buildClassifier

public void buildClassifier(Dataset data)
Description copied from interface: Classifier
Create a classifier from the given data set.

Specified by:
buildClassifier in interface Classifier
Parameters:
data - the data set to be used to create the classifier

classify

public java.lang.Object classify(Instance instance)
Description copied from interface: Classifier
Classify the instance according to this classifier.

Specified by:
classify in interface Classifier
Parameters:
instance - the instance to be classified
Returns:
the class to which this instance belongs or null if it doesn't belong to any of the known classes.

classDistribution

public java.util.Map<java.lang.Object,java.lang.Double> classDistribution(Instance instance)
Description copied from interface: Classifier
Generate the membership distribution for this instance using this classifier. Note: The returned map may not contain a value for all classes that were present in the data set used for training. If the map does not contain a value, the value for that class equals zero.

Specified by:
classDistribution in interface Classifier
Parameters:
instance - the instance to be classified
Returns:
an array with membership degrees for all the various classes in the data set


Copyright © 2006-2008 - Thomas Abeel - All Rights Reserved.