Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Many decorrelated trees vote together. Bias stays similar, variance drops, and generalization improves.
For classification, each tree votes and the majority wins.
Lower inter-tree correlation + more trees means lower variance.
forest = []
for b in range(B):
sample = bootstrap(train_data)
tree = train_tree(sample, max_depth=max_depth, feature_subsample=feature_ratio)
forest.append(tree)
def predict(x):
votes = [tree.predict(x) for tree in forest]
return majority(votes)