Package org.tribuo.common.tree
Interface Node<T extends Output<T>>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractTrainingNode
,ClassifierTrainingNode
,JointRegressorTrainingNode
,LeafNode
,RegressorTrainingNode
,SplitNode
A node in a decision tree.
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies the node and it's children.double
The impurity score of this node.getNextNode
(SparseVector example) Returns the next node in the tree based on the supplied example, or null if it's a leaf.boolean
isLeaf()
Is it a leaf node?
-
Method Details
-
isLeaf
boolean isLeaf()Is it a leaf node?- Returns:
- True if it's a leaf node.
-
getNextNode
Returns the next node in the tree based on the supplied example, or null if it's a leaf.- Parameters:
example
- The example.- Returns:
- The next node down in the tree.
-
getImpurity
double getImpurity()The impurity score of this node.- Returns:
- The node impurity.
-
copy
Copies the node and it's children.- Returns:
- A deep copy.
-