- P. Pošík c
2013 Artificial Intelligence – 1 / 29
Decision Trees
Petr Pošík Czech Technical University in Prague Faculty of Electrical Engineering
- Dept. of Cybernetics
Decision Trees Petr Pok Czech Technical University in Prague - - PowerPoint PPT Presentation
Decision Trees Petr Pok Czech Technical University in Prague Faculty of Electrical Engineering Dept. of Cybernetics This lecture is largely based on the book Artificial Intelligence: A Modern Approach, 3rd ed. by Stuart Russell and Peter
2013 Artificial Intelligence – 1 / 29
Decision Trees What is a decision tree? Attribute description Expressiveness of decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 2 / 29
Decision Trees What is a decision tree? Attribute description Expressiveness of decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 3 / 29
Decision Trees What is a decision tree? Attribute description Expressiveness of decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 3 / 29
Decision Trees What is a decision tree? Attribute description Expressiveness of decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 4 / 29
Decision Trees What is a decision tree? Attribute description Expressiveness of decision trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 5 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 6 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 7 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 8 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 8 / 29
2013 Artificial Intelligence – 9 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 10 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 11 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 11 / 29
2013 Artificial Intelligence – 12 / 29
2013 Artificial Intelligence – 12 / 29
2013 Artificial Intelligence – 13 / 29
2013 Artificial Intelligence – 13 / 29
2013 Artificial Intelligence – 13 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 14 / 29
2013 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
2013 Artificial Intelligence – 16 / 29
2013 Artificial Intelligence – 16 / 29
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 17 / 29
1 begin 2
3
4
5
6
7
8
9
10
11
12
Decision Trees Learning a Decision Tree A computer game A computer game Alternative hypotheses How to choose the best tree? Learning a Decision Tree Attribute importance Choosing the test attribute Choosing the test attribute (special case: binary classification) Choosing the test attribute (example) Choosing subsequent test attribute Decision tree building procedure Algorithm characteristics Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 18 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Overfitting How to prevent
Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 19 / 29
2013 Artificial Intelligence – 20 / 29
2013 Artificial Intelligence – 20 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Overfitting How to prevent
Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 21 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Overfitting How to prevent
Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 21 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Overfitting How to prevent
Broadening the Applicability of Desicion Trees Summary
2013 Artificial Intelligence – 21 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 22 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 23 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 24 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 24 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 25 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 26 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Missing data Multivalued attributes Attributes with different prices Continuous input attributes Continuous output variable Summary
2013 Artificial Intelligence – 27 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary Summary
2013 Artificial Intelligence – 28 / 29
Decision Trees Learning a Decision Tree Generalization and Overfitting Broadening the Applicability of Desicion Trees Summary Summary
2013 Artificial Intelligence – 29 / 29