decision trees
play

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


  1. Decision Trees Petr Pošík 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 Norvig (Prentice Hall, 2010). P. Pošík c � 2013 Artificial Intelligence – 1 / 29

  2. 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 Decision Trees P. Pošík c � 2013 Artificial Intelligence – 2 / 29

  3. What is a decision tree? Decision Trees Decision tree What is a decision tree? Attribute description ✔ is a function that Expressiveness of decision trees ✘ takes a vector of attribute values as its input, and Learning a Decision Tree ✘ returns a “decision” as its output. Generalization and Both input and output values can be measured on a nominal, ordinal, interval, ✘ Overfitting and ratio scales, can be discrete or continuous. Broadening the Applicability of Desicion Trees ✔ The decision is formed via a sequence of tests: Summary ✘ each internal node of the tree represents a test, ✘ the branches are labeled with possible outcomes of the test, and ✘ each leaf node represents a decision to be returned by the tree. P. Pošík c � 2013 Artificial Intelligence – 3 / 29

  4. What is a decision tree? Decision Trees Decision tree What is a decision tree? Attribute description ✔ is a function that Expressiveness of decision trees ✘ takes a vector of attribute values as its input, and Learning a Decision Tree ✘ returns a “decision” as its output. Generalization and Both input and output values can be measured on a nominal, ordinal, interval, ✘ Overfitting and ratio scales, can be discrete or continuous. Broadening the Applicability of Desicion Trees ✔ The decision is formed via a sequence of tests: Summary ✘ each internal node of the tree represents a test, ✘ the branches are labeled with possible outcomes of the test, and ✘ each leaf node represents a decision to be returned by the tree. Decision trees examples: ✔ classification schemata in biology (urˇ covací klíˇ ce) ✔ diagnostic sections in illness encyclopedias online troubleshooting section on software web pages ✔ ✔ ... P. Pošík c � 2013 Artificial Intelligence – 3 / 29

  5. Attribute description Decision Trees Example: A computer game. What is a decision tree? The main character of the game meets various robots along his way. Some behave like Attribute description allies, others like enemies. Expressiveness of decision trees Learning a Decision Tree ally head body smile neck holds class Generalization and Overfitting circle circle yes tie nothing ally Broadening the circle square no tie sword enemy Applicability of Desicion ... ... ... ... ... ... Trees Summary The game engine may use e.g. the following tree to assign the ally or enemy attitude to the generated robots: enemy neck other tie body smile triangle other yes no ally enemy ally enemy P. Pošík c � 2013 Artificial Intelligence – 4 / 29

  6. Expressiveness of decision trees Decision Trees The tree on previous slide is a Boolean decision tree: What is a decision tree? Attribute description ✔ the decision is a binary variable (true, false), and Expressiveness of decision trees ✔ the attributes are discrete. Learning a Decision Tree ✔ It returns ally iff the input attributes satisfy one of the paths leading to an ally leaf: Generalization and Overfitting ally ⇔ ( neck = tie ∧ smile = yes ) ∨ ( neck = ¬ tie ∧ body = triangle ) , Broadening the Applicability of Desicion i.e. in general Trees Goal ⇔ ( Path 1 ∨ Path 2 ∨ . . . ) , where Summary ✘ Path is a conjuction of attribute-value tests, i.e. ✘ ✘ the tree is equivalent to a DNF of a function. Any function in propositional logic can be expressed as a dec. tree. ✔ Trees are a suitable representation for some functions and unsuitable for others. What is the cardinality of the set of Boolean functions of n attributes? ✔ It is equal to the number of truth tables that can be created with n attributes. ✘ The truth table has 2 n rows, i.e. there is 2 2 n different functions. ✘ ✘ The set of trees is even larger; several trees represent the same function. ✔ We need a clever algorithm to find good hypotheses (trees) in such a large space. P. Pošík c � 2013 Artificial Intelligence – 5 / 29

  7. 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) Learning a Decision Tree 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 P. Pošík c � 2013 Artificial Intelligence – 6 / 29

  8. A computer game Decision Trees Example 1: Learning a Decision Tree Can you distinguish between allies and enemies after seeing a few of them? A computer game A computer game Allies Enemies 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 P. Pošík c � 2013 Artificial Intelligence – 7 / 29

  9. A computer game Decision Trees Example 1: Learning a Decision Tree Can you distinguish between allies and enemies after seeing a few of them? A computer game A computer game Allies Enemies 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 Hint: concentrate on the shapes of heads and bodies. P. Pošík c � 2013 Artificial Intelligence – 7 / 29

  10. A computer game Decision Trees Example 1: Learning a Decision Tree Can you distinguish between allies and enemies after seeing a few of them? A computer game A computer game Allies Enemies 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 Hint: concentrate on the shapes of heads and bodies. Answer: Seems like allies have the same shape of their head and body. How would you represent this by a decision tree? (Relation among attributes.) P. Pošík c � 2013 Artificial Intelligence – 7 / 29

  11. A computer game Decision Trees Example 1: Learning a Decision Tree Can you distinguish between allies and enemies after seeing a few of them? A computer game A computer game Allies Enemies 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 Hint: concentrate on the shapes of heads and bodies. Answer: Seems like allies have the same shape of their head and body. How would you represent this by a decision tree? (Relation among attributes.) How do you know that you are right? P. Pošík c � 2013 Artificial Intelligence – 7 / 29

  12. A computer game Decision Trees Example 2: Learning a Decision Tree Some robots changed their attitudes: A computer game A computer game Allies Enemies 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 P. Pošík c � 2013 Artificial Intelligence – 8 / 29

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend