Class CARTClassificationTrainer

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

public class CARTClassificationTrainer extends AbstractCARTTrainer<Label>
A Trainer that uses 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
 
  • Constructor Details

    • CARTClassificationTrainer

      public CARTClassificationTrainer(int maxDepth, float minChildWeight, float minImpurityDecrease, float fractionFeaturesInSplit, boolean useRandomSplitPoints, LabelImpurity impurity, long seed)
      Creates a CART Trainer.
      Parameters:
      maxDepth - The maximum depth of the tree.
      minChildWeight - The minimum node weight to consider it for a split.
      minImpurityDecrease - The minimum decrease in impurity necessary to split a node.
      fractionFeaturesInSplit - The fraction of features available in each split.
      useRandomSplitPoints - Whether to choose split points for features at random.
      impurity - Impurity measure to determine split quality. See LabelImpurity.
      seed - The RNG seed.
    • CARTClassificationTrainer

      public CARTClassificationTrainer()
      Creates a CART Trainer.

      Sets the impurity to the GiniIndex, uses all the features, builds an arbitrary depth tree, computes the exact split point and sets the minimum number of examples in a leaf to AbstractCARTTrainer.MIN_EXAMPLES.

    • CARTClassificationTrainer

      public CARTClassificationTrainer(int maxDepth)
      Creates a CART trainer.

      Sets the impurity to the GiniIndex, uses all the features, computes the exact split point and sets the minimum number of examples in a leaf to AbstractCARTTrainer.MIN_EXAMPLES.

      Parameters:
      maxDepth - The maximum depth of the tree.
    • CARTClassificationTrainer

      public CARTClassificationTrainer(int maxDepth, float fractionFeaturesInSplit, long seed)
      Creates a CART Trainer.

      Sets the impurity to the GiniIndex.

      Parameters:
      maxDepth - The maximum depth of the tree.
      fractionFeaturesInSplit - The fraction of features available in each split.
      seed - The seed for the RNG.
    • CARTClassificationTrainer

      public CARTClassificationTrainer(int maxDepth, float fractionFeaturesInSplit, boolean useRandomSplitPoints, long seed)
      Creates a CART Trainer.

      Sets the impurity to the GiniIndex. Computes the exact split point.

      Parameters:
      maxDepth - The maximum depth of the tree.
      fractionFeaturesInSplit - The fraction of features available in each split.
      useRandomSplitPoints - Whether to choose split points for features at random.
      seed - The seed for the RNG.
    • CARTClassificationTrainer

      public CARTClassificationTrainer(int maxDepth, float minChildWeight, float minImpurityDecrease, float fractionFeaturesInSplit, LabelImpurity impurity, long seed)
      Creates a CART Trainer.

      Computes the exact split point.

      Parameters:
      maxDepth - The maximum depth of the tree.
      minChildWeight - The minimum node weight to consider it for a split.
      minImpurityDecrease - The minimum decrease in impurity necessary to split a node.
      fractionFeaturesInSplit - The fraction of features available in each split.
      impurity - Impurity measure to determine split quality. See LabelImpurity.
      seed - The RNG seed.
  • Method Details