org.wdssii.decisiontree
Class AxialDecisionTree

java.lang.Object
  extended by 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

Field Summary
private  int defaultValue
           
private  int numAttributes
           
private  int numCategories
           
private  AxialTreeNode rootNode
           
 
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.
 
Method Summary
 int classify(float[] data)
          classify input data
 int getDefaultValue()
           
 int getNumAttributes()
           
 int getNumCategories()
           
 AxialTreeNode getRootNode()
           
 void setDefaultValue(int defaultValue)
           
 void setNumAttributes(int numAttributes)
           
 void setNumCategories(int numCategories)
           
 void setRootNode(AxialTreeNode rootNode)
           
 String toJava()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNode

private AxialTreeNode rootNode

defaultValue

private int defaultValue

numAttributes

private int numAttributes

numCategories

private int numCategories
Constructor Detail

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.

Method Detail

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)