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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tribuo.common.tree.AbstractTrainingNode
AbstractTrainingNode.LeafDeterminer -
Field Summary
Fields inherited from class org.tribuo.common.tree.AbstractTrainingNode
DEFAULT_SIZE, depth, greaterThan, impurityScore, leafDeterminer, lessThanOrEqual, numExamples, split, splitID, splitValue -
Constructor Summary
ConstructorsConstructorDescriptionClassifierTrainingNode(LabelImpurity impurity, org.tribuo.Dataset<Label> examples, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructor which creates the inverted file. -
Method Summary
Modifier and TypeMethodDescriptionbuildRandomTree(int[] featureIDs, SplittableRandom rng) Builds a CART tree with randomly chosen split points.buildTree(int[] featureIDs, SplittableRandom rng, boolean useRandomSplitPoints) Builds a tree according to CART (as it does not do multi-way splits on categorical values like C4.5).doublefloatMethods inherited from class org.tribuo.common.tree.AbstractTrainingNode
copy, createSplitNode, getDepth, getNextNode, getNumExamples, isLeaf, shouldMakeLeaf
-
Constructor Details
-
ClassifierTrainingNode
public ClassifierTrainingNode(LabelImpurity impurity, org.tribuo.Dataset<Label> examples, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructor which creates the inverted file.- Parameters:
impurity- The impurity function to use.examples- The training data.leafDeterminer- Contains parameters needed to determine whether a child node will be a leaf.
-
-
Method Details
-
getWeightSum
- Specified by:
getWeightSumin classAbstractTrainingNode<Label>
-
getImpurity
-
buildTree
public List<AbstractTrainingNode<Label>> buildTree(int[] featureIDs, SplittableRandom rng, boolean useRandomSplitPoints) Builds a tree according to CART (as it does not do multi-way splits on categorical values like C4.5).- Specified by:
buildTreein classAbstractTrainingNode<Label>- Parameters:
featureIDs- Indices of the features available in this split.rng- Splittable random number generator.useRandomSplitPoints- Whether to choose split points for features at random.- Returns:
- A possibly empty list of TrainingNodes.
-
buildRandomTree
Builds a CART tree with randomly chosen split points.- Parameters:
featureIDs- Indices of the features available in this split.rng- Splittable random number generator.- Returns:
- A possibly empty list of TrainingNodes.
-
convertTree
- Specified by:
convertTreein classAbstractTrainingNode<Label>- Returns:
- A subtree using the SplitNode and LeafNode classes.
-