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. An exception will be thrown if the user does not supply a decision tree trainer with feature subsampling turned on and random splitting turned off.

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

    • postConfig

      public void postConfig()
      Used by the OLCUT configuration system, and should not be called by external code.
      Specified by:
      postConfig in interface com.oracle.labs.mlrg.olcut.config.Configurable
      Overrides:
      postConfig in class BaggingTrainer<T extends Output<T>>
    • ensembleName

      protected String ensembleName()
      Description copied from class: BaggingTrainer
      Default name of the generated ensemble.
      Overrides:
      ensembleName in class BaggingTrainer<T extends Output<T>>
      Returns:
      The default ensemble name.
    • toString

      public String toString()
      Overrides:
      toString in class BaggingTrainer<T extends Output<T>>