public class Node extends Object implements scala.Serializable, Logging
Constructor and Description |
---|
Node(int id,
double predict,
boolean isLeaf,
scala.Option<Split> split,
scala.Option<Node> leftNode,
scala.Option<Node> rightNode,
scala.Option<InformationGainStats> stats) |
Modifier and Type | Method and Description |
---|---|
void |
build(Node[] nodes)
build the left node and right nodes if not leaf
|
int |
id() |
boolean |
isLeaf() |
scala.Option<Node> |
leftNode() |
double |
predict() |
double |
predict(Vector features)
predict value if node is not leaf
|
scala.Option<Node> |
rightNode() |
scala.Option<Split> |
split() |
scala.Option<InformationGainStats> |
stats() |
String |
toString() |
initialized, initializeIfNecessary, initializeLogging, initLock, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public Node(int id, double predict, boolean isLeaf, scala.Option<Split> split, scala.Option<Node> leftNode, scala.Option<Node> rightNode, scala.Option<InformationGainStats> stats)
public int id()
public double predict()
public boolean isLeaf()
public scala.Option<Split> split()
public scala.Option<Node> leftNode()
public scala.Option<Node> rightNode()
public scala.Option<InformationGainStats> stats()
public String toString()
toString
in class Object
public void build(Node[] nodes)
nodes
- array of nodespublic double predict(Vector features)
features
- feature value