|
Algorithm 1 The algorithm for bagging classifier |
-
1:
for
do
-
2:
Sample, with replacement, n training examples from T, L; call these Tb, Lb.
-
3:
Train a classification tree, fb on Tb, Lb.
-
4:
After training, predictions for unseen samples x
-
5:
obtain the final predictions from all the individual fb on x by taking the average of all predictions for regression or taking the majority vote for a classification problem using Equation (1).
-
6:
end for
|