Class ClassifierTrainingNode
java.lang.Object
org.tribuo.common.tree.AbstractTrainingNode<Label>
org.tribuo.classification.dtree.impl.ClassifierTrainingNode
- All Implemented Interfaces:
Serializable
,Node<Label>
A decision tree node used at training time.
Contains a list of the example indices currently found in this node,
the current impurity and a bunch of other statistics.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.common.tree.AbstractTrainingNode
DEFAULT_SIZE, depth, greaterThan, lessThanOrEqual, numExamples, split, splitID, splitValue
-
Constructor Summary
ConstructorsConstructorDescriptionClassifierTrainingNode
(LabelImpurity impurity, Dataset<Label> examples) Constructor which creates the inverted file. -
Method Summary
Modifier and TypeMethodDescriptionbuildTree
(int[] featureIDs) Builds a tree according to CART (as it does not do multi-way splits on categorical values like C4.5).double
The impurity score of this node.Methods inherited from class org.tribuo.common.tree.AbstractTrainingNode
copy, getDepth, getNextNode, getNumExamples, isLeaf
-
Constructor Details
-
ClassifierTrainingNode
Constructor which creates the inverted file.- Parameters:
impurity
- The impurity function to use.examples
- The training data.
-
-
Method Details
-
buildTree
Builds a tree according to CART (as it does not do multi-way splits on categorical values like C4.5).- Specified by:
buildTree
in classAbstractTrainingNode<Label>
- Parameters:
featureIDs
- Indices of the features available in this split.- Returns:
- A possibly empty list of TrainingNodes.
-
convertTree
- Specified by:
convertTree
in classAbstractTrainingNode<Label>
- Returns:
- A subtree using the SplitNode and LeafNode classes.
-
getImpurity
Description copied from interface:Node
The impurity score of this node.- Returns:
- The node impurity.
-