aima.learning.inductive
Class DecisionTree
java.lang.Object
aima.learning.inductive.DecisionTree
- Direct Known Subclasses:
- ConstantDecisonTree
public class DecisionTree
- extends java.lang.Object
Method Summary |
void |
addLeaf(java.lang.String attributeValue,
java.lang.String decision)
|
void |
addNode(java.lang.String attributeValue,
DecisionTree tree)
|
java.lang.String |
getAttributeName()
|
static DecisionTree |
getStumpFor(DataSet ds,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String returnValueIfMatched,
java.util.List<java.lang.String> unmatchedValues,
java.lang.String returnValueIfUnmatched)
|
static java.util.List<DecisionTree> |
getStumpsFor(DataSet ds,
java.lang.String returnValueIfMatched,
java.lang.String returnValueIfUnmatched)
|
java.lang.Object |
predict(Example e)
|
java.lang.String |
toString()
|
java.lang.String |
toString(int depth,
java.lang.StringBuffer buf)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DecisionTree
protected DecisionTree()
DecisionTree
public DecisionTree(java.lang.String attributeName)
addLeaf
public void addLeaf(java.lang.String attributeValue,
java.lang.String decision)
addNode
public void addNode(java.lang.String attributeValue,
DecisionTree tree)
predict
public java.lang.Object predict(Example e)
getStumpFor
public static DecisionTree getStumpFor(DataSet ds,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String returnValueIfMatched,
java.util.List<java.lang.String> unmatchedValues,
java.lang.String returnValueIfUnmatched)
getStumpsFor
public static java.util.List<DecisionTree> getStumpsFor(DataSet ds,
java.lang.String returnValueIfMatched,
java.lang.String returnValueIfUnmatched)
getAttributeName
public java.lang.String getAttributeName()
- Returns:
- Returns the attributeName.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toString
public java.lang.String toString(int depth,
java.lang.StringBuffer buf)