Algorithm 1.
Weighted Random Forest algorithm pseudocode.
input: Number of Trees (Ntree), random subset of the features (mtry), training dataset (D) |
output: Random Forest (RF) |
1: RF is empty |
2: for each j to Ntree do |
3: Di = Bootstrap Sample (D) |
4: DTi = Random Decision Tree (Di, mtry) |
5: RF = RF ∪ DTi |
6: end |
7: for each i to n do |
8: Compute using Formula (5) |
9: end |
10: for each j to Ntree do |
11: |
12: end |
13: for each j to Ntree do |
14: Compute using Formula (9) |
15: end |
16: for each i to n do |
17: Compute final prediction using Formula (3) |
18: end |
19: return RF |