CZECH TECHNICAL UNIVERSITY IN PRAGUE
Faculty of Electrical Engineering Department of Cybernetics
- P. Poˇ
s´ ık c 2015 Artificial Intelligence – 1 / 29
Decision Trees Petr Po s k This lecture is largely based on the - - PowerPoint PPT Presentation
CZECH TECHNICAL UNIVERSITY IN PRAGUE Faculty of Electrical Engineering Department of Cybernetics Decision Trees Petr Po s k This lecture is largely based on the book Artificial Intelligence: A Modern Approach, 3rd ed. by Stuart
s´ ık c 2015 Artificial Intelligence – 1 / 29
s´ ık c 2015 Artificial Intelligence – 2 / 29
Decision Trees
tree?
description
decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 3 / 29
Decision Trees
tree?
description
decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 3 / 29
Decision Trees
tree?
description
decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 4 / 29
Decision Trees
tree?
description
decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 5 / 29
s´ ık c 2015 Artificial Intelligence – 6 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 8 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 8 / 29
s´ ık c 2015 Artificial Intelligence – 9 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 11 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 11 / 29
s´ ık c 2015 Artificial Intelligence – 12 / 29
s´ ık c 2015 Artificial Intelligence – 12 / 29
s´ ık c 2015 Artificial Intelligence – 13 / 29
i
s´ ık c 2015 Artificial Intelligence – 13 / 29
i
i
s´ ık c 2015 Artificial Intelligence – 13 / 29
i
i
k
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 14 / 29
s´ ık c 2015 Artificial Intelligence – 15 / 29
8 ; H(C, Shead=tri) = HB
2+1
8 ; H(C, Shead=cir) = HB
2+2
8 ; H(C, Shead=sq) = HB
8 · 0.92 + 4 8 · 1 + 1 8 · 0 = 0.84
8 ; H(C, Sbody=tri) = HB
2+0
8 ; H(C, Sbody=cir) = HB
2+1
8 ; H(C, Sbody=sq) = HB
8 · 0 + 3 8 · 0.92 + 3 8 · 0 = 0.35
8 ; H(C, Syes) = HB
3+1
8 ; H(C, Sno) = HB
1+3
8 · 0.81 + 4 8 · 0.81 + 3 8 · 0 = 0.81
8 ; H(C, Sneck=tie) = HB
2+2
8 ; H(C, Sneck=bow) = HB
8 ; H(C, Sneck=no) = HB
2+0
8 · 1 + 2 8 · 0 + 2 8 · 0 = 0.5
8 ; H(C, Sholds=ball) = HB
1+1
8 ; H(C, Sholds=swo) = HB
8 ; H(C, Sholds=flo) = HB
1+0
8 ; H(C, Sholds=no) = HB
2+1
8 · 1 + 2 8 · 0 + 1 8 · 0 + 3 8 · 0.92 = 0.6
s´ ık c 2015 Artificial Intelligence – 16 / 29
s´ ık c 2015 Artificial Intelligence – 16 / 29
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 17 / 29
1 begin 2
3
4
5
6
7
8
9
10
11
12
Decision Trees Learning a Decision Tree
hypotheses
best tree?
Tree
importance
attribute
attribute (special case: binary classification)
attribute (example)
subsequent test attribute
building procedure
characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 18 / 29
s´ ık c 2015 Artificial Intelligence – 19 / 29
s´ ık c 2015 Artificial Intelligence – 20 / 29
s´ ık c 2015 Artificial Intelligence – 20 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting
Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 21 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting
Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 21 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting
Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 21 / 29
s´ ık c 2015 Artificial Intelligence – 22 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 23 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 24 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 24 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 25 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 26 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees
attributes
different prices
attributes
variable Summary
s´ ık c 2015 Artificial Intelligence – 27 / 29
s´ ık c 2015 Artificial Intelligence – 28 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
s´ ık c 2015 Artificial Intelligence – 29 / 29