|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A TreeNode characterizes a partition
of a multidimensional dataset. It holds metadata
that results from a tree model build. This
information forms part of a rule that can be used
to score the data with respect to the target. A
node's ancestor nodes contain the set of
predicates which form a sub-rule that classify the
rows of a dataset as being in or not in the node.
A TreeNode represents a node in a
decision tree. A node's predicate, if any, defines
its child nodes. Nodes without children are called
leaves. The set of leaves in the selected subtree
form the tree model's final partitioning of the
multidimensional data. Nodes may contain
surrogates, which are secondary predicates used
when the requisite data for the primary predicate
are missing.
In addition, a
TreeNode may contain a score
distribution which characterizes the distribution
of data at that node with respect to a reference
dataset.
| Method Summary | |
TreeNode[] |
getAncestors()
Returns all ancestors of this node or null if the node is a root node. |
long |
getCaseCount()
Returns the number of cases assigned to this tree node. |
TreeNode[] |
getChildren()
Returns the direct children of this node or null if the node is a leaf node. |
int |
getIdentifier()
Returns the identifier of the node assigned by the algorithm. |
int |
getLevel()
Returns the level of this node where level(root)=0. |
AttributeStatisticsSet |
getNodeStatistics()
Returns the statistics of the partition represented by this node or null if no statistics are provided. |
int |
getNumberOfChildren()
Returns the number of children available for this tree node. |
TreeNode |
getParent()
Returns the parent of this node or null if the node has no parent. |
Predicate |
getPredicate()
Returns the rule that is used to split the parent node and leads to this node. |
java.lang.Object |
getPrediction()
Returns the predicted target value of this node. |
PredictionType |
getPredictionType()
Returns the type of the prediction. |
Predicate[] |
getSurrogates()
Returns an ordered array of predicates used during scoring when the primary splitting attribute is missing. |
long |
getTargetCount(java.lang.Object target)
Returns the number of cases associated with the specified target. |
long[] |
getTargetCounts()
Returns the array of target counts in the same order as in an array of target values obtained from a CategorySet that are returned from ClassificationModel.getTargetCategorySet. |
boolean |
isLeaf()
Returns boolean indicating whether this node is a leaf (terminal node). |
| Method Detail |
public TreeNode[] getAncestors()
throws JDMException
JDMExceptionpublic long getCaseCount()
public TreeNode[] getChildren()
throws JDMException
JDMExceptionpublic int getIdentifier()
public int getLevel()
public AttributeStatisticsSet getNodeStatistics()
throws JDMException
JDMExceptionpublic int getNumberOfChildren()
public TreeNode getParent()
throws JDMException
JDMExceptionpublic Predicate getPredicate()
public java.lang.Object getPrediction()
public PredictionType getPredictionType()
public Predicate[] getSurrogates()
public long getTargetCount(java.lang.Object target)
throws JDMException
CategorySet that are returned from ClassificationModel.getTargetCategorySet.
target -
JDMExceptionpublic long[] getTargetCounts()
CategorySet that are returned from ClassificationModel.getTargetCategorySet. The full array is returned with zeros for the target values that are not present in the node.
public boolean isLeaf()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||