public class TreeNode extends Object implements Serializable, Cloneable
DecisionTree
node that is a child node of Tree
.Constructor and Description |
---|
TreeNode()
Constructs a
DecisionTreeNode object. |
Modifier and Type | Method and Description |
---|---|
protected TreeNode |
clone()
Returns a clone of a
TreeNode . |
int |
getChildId(int i)
Returns the id of a child node.
|
int[] |
getChildrenIds()
Returns the array of child node id's.
|
double |
getCost()
Returns the misclassification cost of a node (in-sample cost measure at
the current node).
|
int |
getNodeId()
Returns the id of the current node.
|
double |
getNodeSplitCriteriaValue()
Returns the value of the split criteria at the node.
|
double |
getNodeSplitValue()
Returns the value around which the node may be split, if the split
variable is of a continuous type.
|
int |
getNodeValueIndicator(int i)
Returns the indicator value for the
i- th value of the split
variable in the current node, if the split variable is categorical |
int[] |
getNodeValuesIndicator()
Returns the array indicating which values of the split variable apply in
the current node, if the split variable is of discrete type.
|
int |
getNodeVariableId()
Returns the id of the variable that defines the split in the current
node.
|
double |
getNumberOfCases()
Returns the number of cases in the training data that fall into the
current node.
|
int |
getNumberOfChildren()
Returns the number of child nodes associated with the current node.
|
int |
getParentId()
Returns the id of the parent node of the current node.
|
int |
getPredictedClass()
Returns the predicted class at the current node, for response variables
of categorical type.
|
double |
getPredictedVal()
Returns the predicted value at the current node for response variables of
continuous type.
|
double[] |
getSurrogateInfo()
Returns the surrogate split information array.
|
double |
getSurrogateInfo(int i)
Returns a value from the surrogate split information array.
|
double |
getYProb(int i)
Returns a class probability at the current node, if the response variable
is of categorical type.
|
double[] |
getYProbs()
Returns the class probabilities at the current node, if the response
variable is of categorical type.
|
public int getChildId(int i)
i
- an int
specifying the index of the child nodeint
, the id of the child node at index
i
public int[] getChildrenIds()
Note that the length of this array may exceed the actual number of child
nodes. Use TreeNode.getNumberOfChildren()
to determine the actual number
of children.
int
array containing id's of the child nodespublic double getCost()
double
, the misclassification cost of a nodepublic int getNodeId()
The root node has nodeId
= 0.
int
, the node idpublic double getNodeSplitValue()
double
, the value around which the node may be
splitpublic double getNodeSplitCriteriaValue()
double
, the value of the split criteria at the
nodepublic int[] getNodeValuesIndicator()
The array at index i
will be 1 if the i
-th
value of the discrete variable belongs in the node. If it does not belong
to the node, the array has value 0.
int
array containing the indicatorspublic int getNodeValueIndicator(int i)
i-
th value of the split
variable in the current node, if the split variable is categoricalint
, that if 0, the value is not in the node; if
1, it is in the node, meaning that it is in the subset that defines the
data partition of the nodepublic int getNodeVariableId()
int
, the variable that defines the split in the
current nodepublic double getNumberOfCases()
double
, the number of cases (or total case weight)
in the training data that fall into the current nodepublic int getNumberOfChildren()
int
, the number of child nodes associated with
this TreeNode
instancepublic int getParentId()
int
, the id of the parent nodepublic int getPredictedClass()
int
, the predicted classpublic double getPredictedVal()
double
, the predicted value at the current nodepublic double getSurrogateInfo(int i)
i
- an int
specifying which value to returndouble
, the value at index i
public double[] getSurrogateInfo()
double
array containing the surrogate split valuespublic double getYProb(int i)
i
- an int
specifying the index of the classdouble
, the probability of the class at index
i
public double[] getYProbs()
double
array containing the class probabilities at
the current nodeCopyright © 2020 Rogue Wave Software. All rights reserved.