Class RegressorTrainingNode

java.lang.Object
org.tribuo.common.tree.AbstractTrainingNode<Regressor>
org.tribuo.regression.rtree.impl.RegressorTrainingNode
All Implemented Interfaces:
Serializable, Node<Regressor>

public class RegressorTrainingNode extends AbstractTrainingNode<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:
  • Constructor Details

  • 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 class AbstractTrainingNode<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 class AbstractTrainingNode<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

      public Node<Regressor> convertTree()
      Generates a test time tree (made of SplitNode and LeafNode) from the tree rooted at this node.
      Specified by:
      convertTree in class AbstractTrainingNode<Regressor>
      Returns:
      A subtree using the SplitNode and LeafNode classes.
    • invertData

      public static RegressorTrainingNode.InvertedData invertData(Dataset<Regressor> examples)
      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.