T2-L02 — Random Forest
Bagging · Decision boundary evolution · OOB error · Feature importance
1. Decision Boundary: 1 Tree → 10 → 100
Kéo slider để tăng số cây. Boundary smooth dần, OOB error giảm và hội tụ.
Thử: so 1 cây → 10 → 100 — biên răng cưa mượt dần: lấy trung bình nhiều cây nhiễu chính là khử variance.
2. Bootstrap Probability
P(điểm không có mặt) = (1 − 1/n)ⁿ → e⁻¹ ≈ 0.368
3. OOB Error vs CV Error
So sánh OOB error và 5-fold CV error theo số cây (simulated trên Iris-like dataset).
4. Feature Importance (MDI) — Iris Dataset
Normalized mean decrease in impurity theo số cây. Kéo slider để xem stability.