org.wdssii.decisiontree
Class AxialDecisionTree
java.lang.Object
org.wdssii.decisiontree.AxialDecisionTree
- All Implemented Interfaces:
- Serializable, DecisionTree
public class AxialDecisionTree
- extends Object
- implements DecisionTree
A decision tree each of whose branches depends on only one attribute. An
object of this class typically represents a learned decision tree although
the object can be built directly by adding branches.
- Author:
- lakshman
- See Also:
QuinlanC45AxialDecisionTreeCreator
,
Serialized Form
Constructor Summary |
AxialDecisionTree()
|
AxialDecisionTree(AxialTreeNode node,
int defaultValue,
int numAttributes,
int numCategories)
Create with root node and the default category to be used if decision
tree lands up in unlearned space. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rootNode
private AxialTreeNode rootNode
defaultValue
private int defaultValue
numAttributes
private int numAttributes
numCategories
private int numCategories
AxialDecisionTree
public AxialDecisionTree()
AxialDecisionTree
public AxialDecisionTree(AxialTreeNode node,
int defaultValue,
int numAttributes,
int numCategories)
- Create with root node and the default category to be used if decision
tree lands up in unlearned space.
classify
public int classify(float[] data)
- Description copied from interface:
DecisionTree
- classify input data
- Specified by:
classify
in interface DecisionTree
- Returns:
- category (0,1,2...,N-1) Will return -1 if decision tree is unable
to classify data
toJava
public String toJava()
- Specified by:
toJava
in interface DecisionTree
- Returns:
- a Java code version of the decision tree.
getDefaultValue
public int getDefaultValue()
setDefaultValue
public void setDefaultValue(int defaultValue)
getRootNode
public AxialTreeNode getRootNode()
setRootNode
public void setRootNode(AxialTreeNode rootNode)
getNumAttributes
public int getNumAttributes()
setNumAttributes
public void setNumAttributes(int numAttributes)
getNumCategories
public int getNumCategories()
setNumCategories
public void setNumCategories(int numCategories)