Class LeafNode
java.lang.Object
smile.base.cart.LeafNode
- All Implemented Interfaces:
Serializable, Node
- Direct Known Subclasses:
DecisionNode, RegressionNode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdepth()Returns the maximum depth of the tree -- the number of nodes along the longest path from this node down to the farthest leaf node.intleaves()Returns the number of leaf nodes in the subtree.merge()Try to merge the children nodes and return a leaf node.Evaluate the tree over an instance.intsize()Returns the number of samples in the node.
-
Field Details
-
size
protected final int sizeThe number of samples in the node.
-
-
Constructor Details
-
LeafNode
public LeafNode(int size) Constructor.- Parameters:
size- the number of samples in the node
-
-
Method Details
-
size
-
leaves
-
predict
-
depth
-
merge
-