cascading.pattern.model.tree
Class Tree

java.lang.Object
  extended by cascading.pattern.model.tree.Tree
All Implemented Interfaces:
Serializable

public class Tree
extends Object
implements Serializable

Class Tree defines a decision tree.

A Tree is literally a tree data structure where every possible branch is governed by a predicate, when traversed, a branch is chosen if the predicate returns true against the current Tuple.

When a leaf node is reached the "score" is returned, where the score can be a category or numeric value.

When a set of Tree instances should be applied, see ParallelEnsembleAssembly for constructing a random forest implementation.

See Also:
Serialized Form

Field Summary
protected  org.jgrapht.graph.SimpleDirectedGraph<Node,Integer> graph
           
protected  Node root
           
 
Constructor Summary
Tree(String rootID)
           
 
Method Summary
 void addPredicate(String fromID, String toID, Predicate predicate)
           
 void addPredicate(String fromID, String toID, Predicate predicate, Object score)
           
 DecisionTree createDecisionTree(Fields argumentFields)
           
 DecisionTree createDecisionTree(String[] categories, Fields argumentFields)
           
 org.jgrapht.DirectedGraph<Node,Integer> getGraph()
           
 Node getRoot()
           
 Set<Object> getScores()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

graph

protected org.jgrapht.graph.SimpleDirectedGraph<Node,Integer> graph

root

protected Node root
Constructor Detail

Tree

public Tree(String rootID)
Method Detail

getRoot

public Node getRoot()

getScores

public Set<Object> getScores()

getGraph

public org.jgrapht.DirectedGraph<Node,Integer> getGraph()

addPredicate

public void addPredicate(String fromID,
                         String toID,
                         Predicate predicate)

addPredicate

public void addPredicate(String fromID,
                         String toID,
                         Predicate predicate,
                         Object score)

createDecisionTree

public DecisionTree createDecisionTree(Fields argumentFields)

createDecisionTree

public DecisionTree createDecisionTree(String[] categories,
                                       Fields argumentFields)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.