Class RegressorTrainingNode
java.lang.Object
org.tribuo.common.tree.AbstractTrainingNode<Regressor>
org.tribuo.regression.rtree.impl.RegressorTrainingNode
- 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 ClassesModifier and TypeClassDescriptionstatic classTuple containing an inverted dataset (i.e., feature-wise not exmaple-wise).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
ConstructorsConstructorDescriptionRegressorTrainingNode(RegressorImpurity impurity, RegressorTrainingNode.InvertedData tuple, int dimIndex, String dimName, int numExamples, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Regressor> outputInfo, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructs a tree training node for regression problems. -
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).doubleThe impurity score of this node.floatThe sum of the weights associated with this node's examples.invertData(Dataset<Regressor> examples) Inverts a training dataset from row major to column major.Methods inherited from class org.tribuo.common.tree.AbstractTrainingNode
copy, createSplitNode, getDepth, getNextNode, getNumExamples, isLeaf, shouldMakeLeaf
-
Constructor Details
-
RegressorTrainingNode
public RegressorTrainingNode(RegressorImpurity impurity, RegressorTrainingNode.InvertedData tuple, int dimIndex, String dimName, int numExamples, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Regressor> outputInfo, AbstractTrainingNode.LeafDeterminer leafDeterminer) Constructs a tree training node for regression problems.- Parameters:
impurity- The impurity function.tuple- The data tuple.dimIndex- The output dimension index of this node.dimName- The output dimension name.numExamples- The number of examples.featureIDMap- The feature domain.outputInfo- The output domain.leafDeterminer- The leaf determination parameters.
-
-
Method Details
-
getImpurity
public double getImpurity()Description copied from interface:NodeThe impurity score of this node.- Returns:
- The node impurity.
-
getWeightSum
public float getWeightSum()Description copied from class:AbstractTrainingNodeThe sum of the weights associated with this node's examples.- Specified by:
getWeightSumin 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:
buildTreein 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:
convertTreein classAbstractTrainingNode<Regressor>- Returns:
- A subtree using the SplitNode and LeafNode classes.
-
invertData
Inverts a training dataset from row major to column major. This partially de-sparsifies the dataset so it's very expensive in terms of memory.- Parameters:
examples- An input dataset.- Returns:
- A list of TreeFeatures which contain
InvertedFeatures.
-