Page 104 - Data Science Algorithms in a Week
P. 104
Random Forest
Construction of a random decision tree number 1, 2, 3
We construct the next three trees in a similar fashion. We should note that since the
construction is random, a reader who performs another correct construction may arrive at a
different construction. However, if there are sufficiently many random decision trees in a
random forest, then the result of the classification should be very similar across all the
random constructions.
The full construction can be found in the program output in the file
source_code/4/chess.out.
Random forest graph:
Tree 0:
Root
├── [Temperature=Cold]
│ ├── [Wind=None]
│ │ └── [Play=Yes]
│ └──[Wind=Breeze]
│ └── [Play=No]
├── [Temperature=Warm]
│ ├──[Wind=Breeze]
│ │ └── [Play=Yes]
│ └──[Wind=Strong]
│ └── [Play=No]
└── [Temperature=Hot]
└── [Play=Yes]
Tree 1: Root ├── [Wind=Breeze] │ └── [Play=No] ├── [Wind=None] │ ├──
[Temperature=Cold] │ │ └── [Play=Yes] │ ├── [Temperature=Warm] │ │
├── [Sunshine=Sunny] │ │ │ └──[Play=Yes] │ │ └──[Sunshine=Cloudy] │
│ └── [Play=Yes] │ └── [Temperature=Hot] │ └── [Play=No] └──
[Wind=Strong] ├── [Temperature=Cold] │ └── [Play=No] └──
[Temperature=Warm] └── [Play=No]
Tree 2:
Root
├── [Wind=Strong]
│ └── [Play=No]
├── [Wind=None]
│ ├── [Temperature=Cold]
│ │ └── [Play=Yes]
│ └── [Temperature=Warm]
│ └── [Play=Yes]
└── [Wind=Breeze]
├── [Temperature=Hot]
│ └── [Play=Yes]
└── [Temperature=Warm]
└── [Play=Yes]
[ 92 ]