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>
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
-
Field Summary
Fields inherited from class org.tribuo.ensemble.BaggingTrainer
combiner, innerTrainer, numMembers, rng, seed, trainInvocationCounterFields inherited from interface org.tribuo.Trainer
DEFAULT_SEED -
Constructor Summary
ConstructorsConstructorDescriptionRandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers) Constructs a RandomForestTrainer with the default seedTrainer.DEFAULT_SEED.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. -
Method Summary
Methods inherited from class org.tribuo.ensemble.BaggingTrainer
getInvocationCount, getProvenance, train, trainSingleModel
-
Constructor Details
-
RandomForestTrainer
public RandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers) Constructs a RandomForestTrainer with the default seedTrainer.DEFAULT_SEED.Throws
PropertyExceptionif 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
PropertyExceptionif 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
Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable- Overrides:
postConfigin classBaggingTrainer<T extends Output<T>>
-
ensembleName
- Overrides:
ensembleNamein classBaggingTrainer<T extends Output<T>>
-
toString
-