public class RandomForestTrainer<T extends Output<T>> extends BaggingTrainer<T>
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
combiner, innerTrainer, numMembers, rng, seed, trainInvocationCounter
DEFAULT_SEED
Constructor and Description |
---|
RandomForestTrainer(DecisionTreeTrainer<T> trainer,
EnsembleCombiner<T> combiner,
int numMembers)
Constructs a RandomForestTrainer with the default seed
Trainer.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.
|
Modifier and Type | Method and Description |
---|---|
protected String |
ensembleName() |
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
String |
toString() |
getInvocationCount, getProvenance, train, trainSingleModel
public RandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers)
Trainer.DEFAULT_SEED
.
Throws PropertyException
if the trainer is not set to subsample the features.
trainer
- The tree trainer.combiner
- The combining function for the ensemble.numMembers
- The number of ensemble members to train.public RandomForestTrainer(DecisionTreeTrainer<T> trainer, EnsembleCombiner<T> combiner, int numMembers, long seed)
Throws PropertyException
if the trainer is not set to subsample the features.
trainer
- The tree trainer.combiner
- The combining function for the ensemble.numMembers
- The number of ensemble members to train.seed
- The RNG seed.public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
in class BaggingTrainer<T extends Output<T>>
protected String ensembleName()
ensembleName
in class BaggingTrainer<T extends Output<T>>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.