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.public class CategorizationTreeNode<InputType,OutputType,InteriorType> extends AbstractDecisionTreeNode<InputType,OutputType,InteriorType>
CategorizationTreeNode
implements a DecisionTreeNode
for
a tree that does categorization.Modifier and Type | Field and Description |
---|---|
protected OutputType |
outputCategory
The output category of the node.
|
childMap, decider, incomingValue, parent
Constructor and Description |
---|
CategorizationTreeNode()
Creates a new instance of CategorizationTreeNode.
|
CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent,
Categorizer<? super InputType,? extends InteriorType> decider,
OutputType outputCategory,
java.lang.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,
java.lang.Object incomingValue)
Creates a new instance of CategorizationTreeNode.
|
Modifier and Type | Method and Description |
---|---|
CategorizationTreeNode<InputType,OutputType,InteriorType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
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.
|
addChild, chooseChild, getChildMap, getChildren, getDecider, getDepth, getIncomingValue, getParent, getTreeSize, isLeaf, setChildMap, setDecider, setIncomingValue, setParent
protected OutputType outputCategory
public CategorizationTreeNode()
public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, OutputType outputCategory)
parent
- The parent node of this node. Null if this is a root.outputCategory
- The output category.public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, OutputType outputCategory, java.lang.Object incomingValue)
parent
- The parent node of this node. Null if this is a root.outputCategory
- The output category.incomingValue
- The incoming value.public CategorizationTreeNode(DecisionTreeNode<InputType,OutputType> parent, Categorizer<? super InputType,? extends InteriorType> decider, OutputType outputCategory, java.lang.Object incomingValue)
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.public CategorizationTreeNode<InputType,OutputType,InteriorType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractDecisionTreeNode<InputType,OutputType,InteriorType>
public OutputType getOutput(InputType input)
DecisionTreeNode
input
- The input.public OutputType getOutputCategory()
public void setOutputCategory(OutputType outputCategory)
outputCategory
- The output category.