Class SplitNode<T extends Output<T>>
java.lang.Object
org.tribuo.common.tree.SplitNode<T>
- All Implemented Interfaces:
Serializable
,Node<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies the node and it's children.boolean
int
Gets the feature ID that this node uses for splitting.The node used if the value is greater than the splitValue.double
The impurity score of this node.The node used if the value is less than or equal to the splitValue.Return the appropriate child node.int
hashCode()
boolean
isLeaf()
Is it a leaf node?double
The threshold value.toString()
-
Constructor Details
-
SplitNode
public SplitNode(double splitValue, int featureID, double impurity, Node<T> greaterThan, Node<T> lessThanOrEqual) Constructs a split node with the specified split value, feature id, impurity and child nodes.- Parameters:
splitValue
- The feature value to split on.featureID
- The feature id number.impurity
- The impurity of this node at training time.greaterThan
- The node to take if the feature value is greater than the split value.lessThanOrEqual
- The node to take if the feature value is less than or equal to the split value.
-
-
Method Details
-
getNextNode
Return the appropriate child node. If the splitFeature is not present in the example it's value is treated as zero.- Specified by:
getNextNode
in interfaceNode<T extends Output<T>>
- Parameters:
e
- The example to inspect.- Returns:
- The corresponding child node.
-
isLeaf
-
getImpurity
-
copy
-
getFeatureID
public int getFeatureID()Gets the feature ID that this node uses for splitting.- Returns:
- The feature ID.
-
splitValue
public double splitValue()The threshold value.- Returns:
- The threshold value.
-
getGreaterThan
-
getLessThanOrEqual
-
toString
-
equals
-
hashCode
-