งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Decision Tree.

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Decision Tree."— ใบสำเนางานนำเสนอ:

1 Decision Tree

2 Decision Tree เรียกอีกชื่อว่า Classification tree
เป็นเทคนิคแบบ Supervised Learning เป็นวิธีเรียนรู้ที่ไม่ซับซ้อนมากนัก โดยมีโครงสร้างเป็นต้นไม้ แตกแขนงไปตามเงื่อนไขหรือข้อมูลที่ได้คาดคะเนไว้ว่าจะเกิดขึ้น โครงสร้างของ Decision tree จะประกอบด้วย ใบ (Leaf) เป็นส่วนของผลลัพธ์ที่ได้ กิ่ง (Branch) เป็นตัวเชื่อมระหว่างโหนด ราก (Root) เป็นจุดเริ่มต้นของเหตุการณ์

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 สูงสุด จะถูกเลือก

6 Entropy Entropy หรือ Information value
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑝 1 , 𝑝 2 ,…,𝑝 𝑛 =− 𝑝 1 𝑙𝑜𝑔2 𝑝 1 − 𝑝 2 𝑙𝑜𝑔 2𝑝 2 …− 𝑝 𝑛 𝑙𝑜𝑔 2𝑝 𝑛 𝑤ℎ𝑒𝑟𝑒 𝑝 1 , + 𝑝 2 + ,…,+𝑝 𝑛 = 1 หมายเหตุ: info([2,3,4]) = entropy( 2 9 , 3 9 , 4 9 ) = − 2 9 𝑙𝑜𝑔2 2 9 − 3 9 𝑙𝑜𝑔2 3 9 − 4 9 𝑙𝑜𝑔2 4 9

7 ตัวอย่างการคำนวณค่า Entropy
info([9,5]) = entropy( 9 14 , 5 14 ) = − 9 14 𝑙𝑜𝑔 − 5 14 𝑙𝑜𝑔2 5 14 info([2,3]) = entropy( 2 5 , 3 5 ) = − 2 5 𝑙𝑜𝑔 − 3 5 𝑙𝑜𝑔2 3 5 info([4,0]) = entropy( 4 4 , 0 4 ) = − 4 4 𝑙𝑜𝑔 − 0 4 𝑙𝑜𝑔2 0 4 info([3,2]) = entropy( 3 5 , 2 5 ) = − 3 5 𝑙𝑜𝑔 − 2 5 𝑙𝑜𝑔2 2 5

8 ตัวอย่างการคำนวณค่าเฉลี่ยของ information
[ 5 14 ×0.971] = bits

9 ตัวอย่างการคำนวณค่า Information Gain
Gain(outlook) = info([9,5]) - info([2,3], [4,0], [3,2]) = – 0.693 = bits Information value of creating a branch on the outlook attribute

10

11 Which is the best choice?
[yes,no] = [9,5] [2,3] [4,0] [3,2] [3,1] [2,2] [4,2] เลือกได้ 4 กรณี Which is the best choice? [3,3] [3,4] [6,1] [6,2]

12 [2,0] [1,1] [1,0] [0,3] [2,0] [1,2] [1,1]

13


ดาวน์โหลด ppt Decision Tree.

งานนำเสนอที่คล้ายกัน


Ads by Google