Package org.tribuo.regression.rtree.impl
Class JointRegressorTrainingNode
java.lang.Object
org.tribuo.common.tree.AbstractTrainingNode<Regressor>
org.tribuo.regression.rtree.impl.JointRegressorTrainingNode
- All Implemented Interfaces:
Serializable
,Node<Regressor>
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
ConstructorDescriptionJointRegressorTrainingNode
(RegressorImpurity impurity, Dataset<Regressor> examples, boolean normalize, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructor which creates the inverted file. -
Method Summary
Modifier and TypeMethodDescriptionbuildTree
(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).double
The impurity score of this node.float
The sum of the weights associated with this node's examples.Methods inherited from class org.tribuo.common.tree.AbstractTrainingNode
copy, createSplitNode, getDepth, getNextNode, getNumExamples, isLeaf, shouldMakeLeaf
-
Constructor Details
-
JointRegressorTrainingNode
public JointRegressorTrainingNode(RegressorImpurity impurity, Dataset<Regressor> examples, boolean normalize, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructor which creates the inverted file.- Parameters:
impurity
- The impurity function to use.examples
- The training data.normalize
- Normalizes the leaves so each leaf has a distribution which sums to 1.0.leafDeterminer
- Contains parameters needed to determine whether a node is a leaf.
-
-
Method Details
-
getImpurity
public double getImpurity()Description copied from interface:Node
The impurity score of this node.- Returns:
- The node impurity.
-
getWeightSum
public float getWeightSum()Description copied from class:AbstractTrainingNode
The sum of the weights associated with this node's examples.- Specified by:
getWeightSum
in classAbstractTrainingNode<Regressor>
- Returns:
- the sum of the weights associated with this node's examples.
-
buildTree
public List<AbstractTrainingNode<Regressor>> 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:
buildTree
in classAbstractTrainingNode<Regressor>
- 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.
-
convertTree
- Specified by:
convertTree
in classAbstractTrainingNode<Regressor>
- Returns:
- A subtree using the SplitNode and LeafNode classes.
-