3. ตัวอย่าง
root
branch
leaf
If outlook=sunny and humidity=normal then play=yes
If outlook=overcast then play=yes
If outlook=rainy and windy=false then play=yes
If outlook=sunny and humidity=high then play=no
If outlook=rainy and windy=true then play=no
4. Decision Tree
• การเรียนรู้ด ้วย Decision tree เป็นการเรียนรู้จาก
การคาดคะเนเหตุการณ์ต่างๆที่อาจเกิดขึ้น
• อาศัยเงื่อนไขเป็นตัวช่วยในการตัดสินใจว่าเมื่อมี
เหตุการณ์ใดๆขึ้น จะแสดงผลออกมาอย่างไร
• ต ้องการต ้นไม ้ให ้มีขนาดเล็ก
• การคาดคะเนจะถูกนาเสนอด ้วยรูปแบบการ
ตัดสินใจ (if/then/else)
– If outlook=overcast then play=yes
5. Information Gain
• ค่า Information gain ถูกนามาใช ้ในการเลือก
attribute ในแต่ละ node ของ tree
• attribute ตัวใดทีมีค่า Information gain สูงสุด
จะถูกเลือก