gov.sandia.cognition.learning.algorithm.tree
Class CategorizationTreeNode<InputType,OutputType,InteriorType>

java.lang.Object
  extended by gov.sandia.cognition.learning.algorithm.tree.AbstractDecisionTreeNode<InputType,OutputType,InteriorType>
      extended by gov.sandia.cognition.learning.algorithm.tree.CategorizationTreeNode<InputType,OutputType,InteriorType>
Type Parameters:
InputType - The input type for the tree to make a decision about.
OutputType - The output type of the tree.
InteriorType - The type that is used to make a decision at this node.
All Implemented Interfaces:
DecisionTreeNode<InputType,OutputType>, CloneableSerializable, Serializable, Cloneable

public class CategorizationTreeNode<InputType,OutputType,InteriorType>
extends AbstractDecisionTreeNode<InputType,OutputType,InteriorType>

The CategorizationTreeNode implements a DecisionTreeNode for a tree that does categorization.

Since:
2.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  OutputType outputCategory
          The output category of the node.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.tree.AbstractDecisionTreeNode
childMap, decider, incomingValue, parent
 
Constructor Summary
CategorizationTreeNode()
          Creates a new instance of CategorizationTreeNode.
CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, Categorizer<? super InputType,? extends InteriorType> decider, OutputType outputCategory, Object incomingValue)
          Creates a new instance of CategorizationTreeNode.
CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, OutputType outputCategory)
          Creates a new instance of CategorizationTreeNode.
CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, OutputType outputCategory, Object incomingValue)
          Creates a new instance of CategorizationTreeNode.
 
Method Summary
 CategorizationTreeNode<InputType,OutputType,InteriorType> clone()
          Creates a new clone (shallow copy) of this object.
 OutputType getOutput(InputType input)
          Gets the local output of this node for the given input.
 OutputType getOutputCategory()
          Gets the output category for the node.
 void setOutputCategory(OutputType outputCategory)
          Sets the output category for the node.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.tree.AbstractDecisionTreeNode
addChild, chooseChild, getChildMap, getChildren, getDecider, getDepth, getIncomingValue, getParent, getTreeSize, isLeaf, setChildMap, setDecider, setIncomingValue, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputCategory

protected OutputType outputCategory
The output category of the node. All nodes should have this, but it is absolutely required for a leaf node.

Constructor Detail

CategorizationTreeNode

public CategorizationTreeNode()
Creates a new instance of CategorizationTreeNode.


CategorizationTreeNode

public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent,
                              OutputType outputCategory)
Creates a new instance of CategorizationTreeNode.

Parameters:
parent - The parent node of this node. Null if this is a root.
outputCategory - The output category.

CategorizationTreeNode

public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent,
                              OutputType outputCategory,
                              Object incomingValue)
Creates a new instance of CategorizationTreeNode.

Parameters:
parent - The parent node of this node. Null if this is a root.
outputCategory - The output category.
incomingValue - The incoming value.

CategorizationTreeNode

public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent,
                              Categorizer<? super InputType,? extends InteriorType> decider,
                              OutputType outputCategory,
                              Object incomingValue)
Creates a new instance of CategorizationTreeNode.

Parameters:
parent - The parent node of this node. Null if this is a root.
decider - The decision function.
outputCategory - The output category.
incomingValue - The incoming value.
Method Detail

clone

public CategorizationTreeNode<InputType,OutputType,InteriorType> clone()
Description copied from interface: CloneableSerializable
Creates a new clone (shallow copy) of this object.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractDecisionTreeNode<InputType,OutputType,InteriorType>
Returns:
A new clone (shallow copy) of this object.

getOutput

public OutputType getOutput(InputType input)
Description copied from interface: DecisionTreeNode
Gets the local output of this node for the given input. This is done to determine the output value for a leaf node or the output value in the case that there is no corresponding child node for an input.

Parameters:
input - The input.
Returns:
The local output value for the given input.

getOutputCategory

public OutputType getOutputCategory()
Gets the output category for the node.

Returns:
The output category.

setOutputCategory

public void setOutputCategory(OutputType outputCategory)
Sets the output category for the node.

Parameters:
outputCategory - The output category.