org.apache.mahout.df
Class DecisionForest

java.lang.Object
  extended by org.apache.mahout.df.DecisionForest

public class DecisionForest
extends java.lang.Object

Represents a forest of decision trees.


Constructor Summary
protected DecisionForest()
           
  DecisionForest(java.util.List<Node> trees)
           
 
Method Summary
 void classify(Data data, PredictionCallback callback)
          Classifies the data and calls callback for each classification
 int classify(java.util.Random rng, Instance instance)
          predicts the label for the instance
 boolean equals(java.lang.Object obj)
           
 java.util.List<Node> getTrees()
           
 int hashCode()
           
 long meanMaxDepth()
          Mean maximum depth per tree
 long meanNbNodes()
          Mean number of nodes per tree
 long nbNodes()
          Total number of nodes in all the trees
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecisionForest

protected DecisionForest()

DecisionForest

public DecisionForest(java.util.List<Node> trees)
Method Detail

getTrees

public java.util.List<Node> getTrees()

classify

public void classify(Data data,
                     PredictionCallback callback)
Classifies the data and calls callback for each classification

Parameters:
data -
callback -

classify

public int classify(java.util.Random rng,
                    Instance instance)
predicts the label for the instance

Parameters:
rng - Random number generator, used to break ties randomly
instance -
Returns:
-1 if the label cannot be predicted

meanNbNodes

public long meanNbNodes()
Mean number of nodes per tree

Returns:

nbNodes

public long nbNodes()
Total number of nodes in all the trees

Returns:

meanMaxDepth

public long meanMaxDepth()
Mean maximum depth per tree

Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.