# Random Forest¶

Random forest is an ensemble classifier that consists of many decision trees and outputs the majority vote of individual trees. The method combines bagging idea and the random selection of features.

Each tree is constructed using the following algorithm:

• If the number of cases in the training set is N, randomly sample N cases with replacement from the original data. This sample will be the training set for growing the tree.

• If there are M input variables, a number m << M is specified such that at each node, m variables are selected at random out of the M and the best split on these m is used to split the node. The value of m is held constant during the forest growing.

• Each tree is grown to the largest extent possible. There is no pruning.

from miml import datasets
from miml.regression import RandomForest

fn = os.path.join(datasets.get_data_home(), 'regression',
'diabetes.csv')

>>> run script...