public interface Node
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
int |
depth()
Returns the maximum depth of the tree -- the number of
nodes along the longest path from this node
down to the farthest leaf node.
|
double |
deviance()
Returns the deviance of node.
|
java.lang.String |
dot(smile.data.type.StructType schema,
smile.data.type.StructField response,
int id)
Returns a dot representation for visualization.
|
int |
leafs()
Returns the number of leaf nodes in the subtree.
|
Node |
merge()
Try to merge the children nodes and return a leaf node.
|
LeafNode |
predict(smile.data.Tuple x)
Evaluate the tree over an instance.
|
int |
size()
Returns the number of samples in the node.
|
int[] |
toString(smile.data.type.StructType schema,
smile.data.type.StructField response,
InternalNode parent,
int depth,
java.math.BigInteger id,
java.util.List<java.lang.String> lines)
Adds the string representation (R's rpart format) to a collection.
|
LeafNode predict(smile.data.Tuple x)
java.lang.String dot(smile.data.type.StructType schema, smile.data.type.StructField response, int id)
schema
- the schema of dataresponse
- the schema of response variableid
- node idint size()
int leafs()
int depth()
double deviance()
Node merge()
int[] toString(smile.data.type.StructType schema, smile.data.type.StructField response, InternalNode parent, int depth, java.math.BigInteger id, java.util.List<java.lang.String> lines)
schema
- the schema of dataresponse
- the schema of response variableparent
- the parent nodedepth
- the depth of node in the tree. The root node is at depth 0.id
- node idlines
- the collection of node's string representation.