Class RandomForestTrainer<T extends Output<T>>

java.lang.Object
org.tribuo.ensemble.BaggingTrainer<T>
org.tribuo.common.tree.RandomForestTrainer<T>
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>, Trainer<T>

public class RandomForestTrainer<T extends Output<T>> extends BaggingTrainer<T>
A trainer which produces a random forest.

Random Forests are basically bagged trees, with feature subsampling at each of the nodes. It's up to the user to supply a decision tree trainer which has feature subsampling turned on by checking DecisionTreeTrainer.getFractionFeaturesInSplit().

See:

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

    • RandomForestTrainer

      public RandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers)
      Constructs a RandomForestTrainer with the default seed Trainer.DEFAULT_SEED.

      Throws PropertyException if the trainer is not set to subsample the features.

      Parameters:
      trainer - The tree trainer.
      combiner - The combining function for the ensemble.
      numMembers - The number of ensemble members to train.
    • RandomForestTrainer

      public RandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers, long seed)
      Constructs a RandomForestTrainer with the supplied seed, trainer, combining function and number of members.

      Throws PropertyException if the trainer is not set to subsample the features.

      Parameters:
      trainer - The tree trainer.
      combiner - The combining function for the ensemble.
      numMembers - The number of ensemble members to train.
      seed - The RNG seed.
  • Method Details