T2-L01 — KNN & Decision Tree

KNN classifier · Entropy calculator · Decision Tree builder (Play Tennis)

KNN — 2D Classification

Click canvas để thêm điểm trắng (test point). Kéo slider k để xem boundary thay đổi. Click "Reset" để thêm dataset mới.

3
Click vào canvas để đặt điểm test và xem KNN predict.

Entropy & Information Gain Calculator

H(S) = −Σ pᵢ · log₂(pᵢ)
9 5
H = ? bit

Information Gain — Play Tennis

Root entropy H(S)=0.940 bit (9 Yes, 5 No). IG của từng feature:

Decision Tree — Play Tennis (step-by-step)

Nhấn "Next split" để thêm từng nhánh của cây theo thuật toán ID3.

Nhấn "Next split" để bắt đầu xây cây từ root.