Class AbstractCARTTrainer<T extends Output<T>>

java.lang.Object
org.tribuo.common.tree.AbstractCARTTrainer<T>
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>, DecisionTreeTrainer<T>, SparseTrainer<T>, Trainer<T>, WeightedExamples

public abstract class AbstractCARTTrainer<T extends Output<T>> extends Object implements DecisionTreeTrainer<T>
Base class for Trainer's that use an approximation of the CART algorithm to build a decision tree.

See:

 J. Friedman, T. Hastie, & R. Tibshirani.
 "The Elements of Statistical Learning"
 Springer 2001. PDF
 
  • Field Details

    • MIN_EXAMPLES

      public static final int MIN_EXAMPLES
      Default minimum weight of examples allowed in a leaf node.
      See Also:
    • minChildWeight

      @Config(description="The minimum weight allowed in a child node.") protected float minChildWeight
      Minimum weight of examples allowed in a leaf.
    • maxDepth

      @Config(description="The maximum depth of the tree.") protected int maxDepth
      Maximum tree depth. Integer.MAX_VALUE indicates the depth is unlimited.
    • minImpurityDecrease

      @Config(description="The decrease in impurity needed in order to split the node.") protected float minImpurityDecrease
      Minimum impurity decrease. The decrease in impurity needed in order to split the node.
    • fractionFeaturesInSplit

      @Config(description="The fraction of features to consider in each split. 1.0f indicates all features are considered.") protected float fractionFeaturesInSplit
      Number of features to sample per split. 1 indicates all features are considered.
    • useRandomSplitPoints

      @Config(description="Whether to choose split points for features at random.") protected boolean useRandomSplitPoints
      Whether to choose split points for features at random.
    • seed

      @Config(description="The RNG seed to use when sampling features in a split.") protected long seed
    • rng

      protected SplittableRandom rng
    • trainInvocationCounter

      protected int trainInvocationCounter
  • Constructor Details

    • AbstractCARTTrainer

      protected AbstractCARTTrainer(int maxDepth, float minChildWeight, float minImpurityDecrease, float fractionFeaturesInSplit, boolean useRandomSplitPoints, long seed)
      After calls to this superconstructor subclasses must call postConfig().
      Parameters:
      maxDepth - The maximum depth of the tree.
      minChildWeight - The minimum child weight allowed.
      minImpurityDecrease - The minimum decrease in impurity necessary to split a node.
      fractionFeaturesInSplit - The fraction of features to consider at each split.
      useRandomSplitPoints - Whether to choose split points for features at random.
      seed - The seed for the feature subsampling RNG.
  • Method Details