InputType
- The input type to categorize.OutputType
- The output category type.public class CategorizationTree<InputType,OutputType> extends DecisionTree<InputType,OutputType> implements Categorizer<InputType,OutputType>
CategorizationTree
class extends the DecisionTree
class
to implement a decision tree that does categorization.Modifier and Type | Field and Description |
---|---|
protected java.util.Set<OutputType> |
categories
The list of possible output categories.
|
rootNode
Constructor and Description |
---|
CategorizationTree()
Creates a new instance of CategorizationTree.
|
CategorizationTree(DecisionTreeNode<InputType,OutputType> rootNode,
java.util.Set<OutputType> categories)
Creates a new instance of CategorizationTree.
|
Modifier and Type | Method and Description |
---|---|
CategorizationTree<InputType,OutputType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
java.util.Set<OutputType> |
getCategories()
Gets the list of possible categories that the categorizer can produce.
|
void |
setCategories(java.util.Set<OutputType> categories)
Sets the possible output categories.
|
evaluate, evaluateNode, findTerminalNode, findTerminalNode, getRootNode, setRootNode
protected java.util.Set<OutputType> categories
public CategorizationTree()
public CategorizationTree(DecisionTreeNode<InputType,OutputType> rootNode, java.util.Set<OutputType> categories)
rootNode
- The root node of the tree.categories
- The possible output categories.public CategorizationTree<InputType,OutputType> 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 DecisionTree<InputType,OutputType>
public java.util.Set<OutputType> getCategories()
getCategories
in interface Categorizer<InputType,OutputType>
public void setCategories(java.util.Set<OutputType> categories)
categories
- The collection of possible output categories.