org.wdssii.decisiontree
Class AxialTreeNode

java.lang.Object
  extended by org.wdssii.decisiontree.AxialTreeNode
All Implemented Interfaces:
Serializable

public class AxialTreeNode
extends Object
implements Serializable

A node in an axial decision tree has two branches and a condition to decide which branch to take.

Author:
lakshman
See Also:
Serialized Form

Field Summary
private  int attributeNumber
           
private  int defaultCategory
           
private  AxialTreeNode left
           
private  AxialTreeNode right
           
private  float thresh
           
 
Constructor Summary
AxialTreeNode()
           
AxialTreeNode(int category)
          node that supplies the same category for all inputs
AxialTreeNode(int attributeNo, float thresh, AxialTreeNode leftNode, AxialTreeNode rightNode, int defaultCategory)
          A node in the tree that branches out.
 
Method Summary
 void appendJava(StringBuilder sb, int depth, String newline)
           
 int classify(float[] data)
           
 int getAttributeNumber()
           
 int getDefaultCategory()
           
 AxialTreeNode getLeft()
           
 AxialTreeNode getRight()
           
 float getThresh()
           
(package private)  boolean isHandledByLeftBranch(float[] data)
           
(package private)  boolean isHandledByRightBranch(float[] data)
           
 void normalize()
           
 void setAttributeNumber(int attributeNumber)
           
 void setDefaultCategory(int defaultCategory)
           
 void setLeft(AxialTreeNode left)
           
 void setRight(AxialTreeNode right)
           
 void setThresh(float thresh)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thresh

private float thresh

attributeNumber

private int attributeNumber

left

private AxialTreeNode left

right

private AxialTreeNode right

defaultCategory

private int defaultCategory
Constructor Detail

AxialTreeNode

public AxialTreeNode()

AxialTreeNode

public AxialTreeNode(int category)
node that supplies the same category for all inputs


AxialTreeNode

public AxialTreeNode(int attributeNo,
                     float thresh,
                     AxialTreeNode leftNode,
                     AxialTreeNode rightNode,
                     int defaultCategory)
A node in the tree that branches out.

Method Detail

classify

public int classify(float[] data)

isHandledByLeftBranch

boolean isHandledByLeftBranch(float[] data)

isHandledByRightBranch

boolean isHandledByRightBranch(float[] data)

getLeft

public AxialTreeNode getLeft()

setLeft

public void setLeft(AxialTreeNode left)

getRight

public AxialTreeNode getRight()

setRight

public void setRight(AxialTreeNode right)

toString

public String toString()
Overrides:
toString in class Object

appendJava

public void appendJava(StringBuilder sb,
                       int depth,
                       String newline)

normalize

public void normalize()

getDefaultCategory

public int getDefaultCategory()

getAttributeNumber

public int getAttributeNumber()

setAttributeNumber

public void setAttributeNumber(int attributeNumber)

getThresh

public float getThresh()

setThresh

public void setThresh(float thresh)

setDefaultCategory

public void setDefaultCategory(int defaultCategory)