public class OrdinalNode extends InternalNode
Constructor and Description |
---|
OrdinalNode(int feature,
double value,
double score,
double deviance,
Node trueChild,
Node falseChild)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
branch(smile.data.Tuple x)
Returns true if the instance goes to the true branch.
|
java.lang.String |
dot(smile.data.type.StructType schema,
smile.data.type.StructField response,
int id)
Returns a dot representation for visualization.
|
LeafNode |
predict(smile.data.Tuple x)
Evaluates the tree over an instance.
|
OrdinalNode |
replace(Node trueChild,
Node falseChild)
Returns a new internal node with children replaced.
|
java.lang.String |
toString(smile.data.type.StructType schema,
boolean trueBranch)
Returns the string representation of branch.
|
public LeafNode predict(smile.data.Tuple x)
InternalNode
predict
in interface Node
predict
in class InternalNode
public boolean branch(smile.data.Tuple x)
InternalNode
branch
in class InternalNode
public OrdinalNode replace(Node trueChild, Node falseChild)
InternalNode
replace
in class InternalNode
public java.lang.String dot(smile.data.type.StructType schema, smile.data.type.StructField response, int id)
Node
schema
- the schema of dataresponse
- the schema of response variableid
- node idpublic java.lang.String toString(smile.data.type.StructType schema, boolean trueBranch)
InternalNode
toString
in class InternalNode
schema
- the schema of data.trueBranch
- for true or false branch.