Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.4 KB

File metadata and controls

41 lines (25 loc) · 1.4 KB

Random Forest

A Random Forest is an ensemble learning method which implements multiple decision trees during training. It predicts by using a combination rule on the outputs of individual decision trees.

See Breiman2001 for a detailed introduction.

Example

CDenseFeatures (here 64 bit floats aka RealFeatures) and CMulticlassLabels are created from training and test data file

random_forest.sg:create_features

Combination rules to be used for prediction are derived form the CCombinationRule class. Here we create a CMajorityVote class to be used as a combination rule.

random_forest.sg:create_combination_rule

Next an instance of CRandomForest is created. The parameters provided are the number of attributes to be chosen randomly to select from and the number of trees.

random_forest.sg:create_instance

Then we run the train random forest and apply it to test data, which here gives CMulticlassLabels.

random_forest.sg:train_and_apply

We can evaluate test performance via e.g. CMulticlassAccuracy as well as get the "out of bag error".

random_forest.sg:evaluate_accuracy

References

Random_forest

Out-of-bag_error

../../references.bib