Machine Learning Chapter 3. Decision Tree Learning

Slides:



Advertisements
Similar presentations
1 Machine Learning: Lecture 3 Decision Tree Learning (Based on Chapter 3 of Mitchell T.., Machine Learning, 1997)
Advertisements

Decision Tree Learning - ID3
Decision Trees Decision tree representation ID3 learning algorithm
1er. Escuela Red ProTIC - Tandil, de Abril, Decision Tree Learning 3.1 Introduction –Method for approximation of discrete-valued target functions.
ICS320-Foundations of Adaptive and Learning Systems
Classification Techniques: Decision Tree Learning
Decision Tree Learning 主講人:虞台文 大同大學資工所 智慧型多媒體研究室.
Decision Trees IDHairHeightWeightLotionResult SarahBlondeAverageLightNoSunburn DanaBlondeTallAverageYesnone AlexBrownTallAverageYesNone AnnieBlondeShortAverageNoSunburn.
Decision Tree Learning
Machine Learning Group University College Dublin Decision Trees What is a Decision Tree? How to build a good one…
Part 7.3 Decision Trees Decision tree representation ID3 learning algorithm Entropy, information gain Overfitting.
CS 590M Fall 2001: Security Issues in Data Mining Lecture 4: ID3.
Decision tree LING 572 Fei Xia 1/10/06. Outline Basic concepts Main issues Advanced topics.
Decision Tree Learning Learning Decision Trees (Mitchell 1997, Russell & Norvig 2003) –Decision tree induction is a simple but powerful learning paradigm.
Induction of Decision Trees
Università di Milano-Bicocca Laurea Magistrale in Informatica Corso di APPRENDIMENTO E APPROSSIMAZIONE Prof. Giancarlo Mauri Lezione 3 - Learning Decision.
Decision Trees Decision tree representation Top Down Construction
1 Interacting with Data Materials from a Course in Princeton University -- Hu Yan.
Example of a Decision Tree categorical continuous class Splitting Attributes Refund Yes No NO MarSt Single, Divorced Married TaxInc NO < 80K > 80K.
Ch 3. Decision Tree Learning
Decision Tree Learning
Decision tree LING 572 Fei Xia 1/16/06.
Decision tree learning
By Wang Rui State Key Lab of CAD&CG
Fall 2004 TDIDT Learning CS478 - Machine Learning.
Decision Trees Advanced Statistical Methods in NLP Ling572 January 10, 2012.
Learning what questions to ask. 8/29/03Decision Trees2  Job is to build a tree that represents a series of questions that the classifier will ask of.
Artificial Intelligence 7. Decision trees
Mohammad Ali Keyvanrad
Decision tree learning Maria Simi, 2010/2011 Inductive inference with decision trees  Decision Trees is one of the most widely used and practical methods.
Machine Learning Lecture 10 Decision Tree Learning 1.
CpSc 810: Machine Learning Decision Tree Learning.
Decision Trees DefinitionDefinition MechanismMechanism Splitting FunctionSplitting Function Issues in Decision-Tree LearningIssues in Decision-Tree Learning.
Decision-Tree Induction & Decision-Rule Induction
Decision Tree Learning
For Wednesday No reading Homework: –Chapter 18, exercise 6.
Machine Learning, Decision Trees, Overfitting Machine Learning Tom M. Mitchell Machine Learning Department Carnegie Mellon University January 14,
For Monday No new reading Homework: –Chapter 18, exercises 3 and 4.
CS 8751 ML & KDDDecision Trees1 Decision tree representation ID3 learning algorithm Entropy, Information gain Overfitting.
1 Universidad de Buenos Aires Maestría en Data Mining y Knowledge Discovery Aprendizaje Automático 5-Inducción de árboles de decisión (2/2) Eduardo Poggi.
CS 5751 Machine Learning Chapter 3 Decision Tree Learning1 Decision Trees Decision tree representation ID3 learning algorithm Entropy, Information gain.
机器学习 陈昱 北京大学计算机科学技术研究所 信息安全工程研究中心. 课程基本信息  主讲教师:陈昱 Tel :  助教:程再兴, Tel :  课程网页:
1 Decision Tree Learning Original slides by Raymond J. Mooney University of Texas at Austin.
Decision Trees, Part 1 Reading: Textbook, Chapter 6.
Decision Tree Learning
Decision Tree Learning Presented by Ping Zhang Nov. 26th, 2007.
Seminar on Machine Learning Rada Mihalcea Decision Trees Very short intro to Weka January 27, 2003.
Outline Decision tree representation ID3 learning algorithm Entropy, Information gain Issues in decision tree learning 2.
Decision Tree Learning DA514 - Lecture Slides 2 Modified and expanded from: E. Alpaydin-ML (chapter 9) T. Mitchell-ML.
Review of Decision Tree Learning Bamshad Mobasher DePaul University Bamshad Mobasher DePaul University.
CSE573 Autumn /11/98 Machine Learning Administrative –Finish this topic –The rest of the time is yours –Final exam Tuesday, Mar. 17, 2:30-4:20.
Machine Learning Inductive Learning and Decision Trees
Università di Milano-Bicocca Laurea Magistrale in Informatica
CS 9633 Machine Learning Decision Tree Learning
Decision Tree Learning
Decision trees (concept learnig)
Machine Learning Lecture 2: Decision Tree Learning.
Decision trees (concept learnig)
Decision Tree Learning
Introduction to Machine Learning Algorithms in Bioinformatics: Part II
Issues in Decision-Tree Learning Avoiding overfitting through pruning
Decision Tree Saed Sayad 9/21/2018.
Machine Learning Chapter 3. Decision Tree Learning
Machine Learning: Lecture 3
Decision Trees Decision tree representation ID3 learning algorithm
Machine Learning Chapter 3. Decision Tree Learning
Decision Trees.
Decision Trees Decision tree representation ID3 learning algorithm
Decision Trees Berlin Chen
INTRODUCTION TO Machine Learning
Presentation transcript:

Machine Learning Chapter 3. Decision Tree Learning Tom M. Mitchell

Abstract Decision tree representation ID3 learning algorithm Entropy, Information gain Overfitting

Decision Tree for PlayTennis

A Tree to Predict C-Section Risk Learned from medical records of 1000 women Negative examples are C-sections

Decision Trees Decision tree representation: How would we represent: Each internal node tests an attribute Each branch corresponds to attribute value Each leaf node assigns a classification How would we represent: , , XOR (A  B)  (C  D  E) M of N

When to Consider Decision Trees Instances describable by attribute-value pairs Target function is discrete valued Disjunctive hypothesis may be required Possibly noisy training data Examples: Equipment or medical diagnosis Credit risk analysis Modeling calendar scheduling preferences

Top-Down Induction of Decision Trees Main loop: 1. A  the “best” decision attribute for next node 2. Assign A as decision attribute for node 3. For each value of A, create new descendant of node 4. Sort training examples to leaf nodes 5. If training examples perfectly classified, Then STOP, Else iterate over new leaf nodes Which attribute is best?

Entropy(1/2) S is a sample of training examples p⊕ is the proportion of positive examples in S p⊖ is the proportion of negative examples in S Entropy measures the impurity of S Entropy(S)  - p⊕log2 p⊕ - p⊖log2 p⊖

Entropy(2/2) Entropy(S) = expected number of bits needed to encode class (⊕ or ⊖) of randomly drawn member of S (under the optimal, shortest-length code) Why? Information theory: optimal length code assigns log2p bits to message having probability p. So, expected number of bits to encode ⊕ or ⊖ of random member of S: p⊕(-log2 p⊕) + p⊖(-log2 p⊖) Entropy(S)  - p⊕log2 p⊕ - p⊖log2 p⊖

Information Gain Gain(S, A) = expected reduction in entropy due to sorting on A

Training Examples

Selecting the Next Attribute(1/2) Which attribute is the best classifier?

Selecting the Next Attribute(2/2) Ssunny = {D1,D2,D8,D9,D11} Gain (Ssunny , Humidity) = .970 - (3/5) 0.0 - (2/5) 0.0 = .970 Gain (Ssunny , Temperature) = .970 - (2/5) 0.0 - (2/5) 1.0 - (1/5) 0.0 = .570 Gain (Ssunny, Wind) = .970 - (2/5) 1.0 - (3/5) .918 = .019

Hypothesis Space Search by ID3(1/2)

Hypothesis Space Search by ID3(2/2) Hypothesis space is complete! Target function surely in there... Outputs a single hypothesis (which one?) Can’t play 20 questions... No back tracking Local minima... Statistically-based search choices Robust to noisy data... Inductive bias: approx “prefer shortest tree”

Inductive Bias in ID3 Note H is the power set of instances X → Unbiased? Not really... Preference for short trees, and for those with high information gain attributes near the root Bias is a preference for some hypotheses, rather than a restriction of hypothesis space H Occam's razor: prefer the shortest hypothesis that fits the data

Occam’s Razor Why prefer short hypotheses? Argument in favor : Fewer short hyps. than long hyps. → a short hyp that fits data unlikely to be coincidence → a long hyp that fits data might be coincidence Argument opposed : There are many ways to define small sets of hyps e.g., all trees with a prime number of nodes that use attributes beginning with “Z” What's so special about small sets based on size of hypothesis??

Overfitting in Decision Trees Consider adding noisy training example #15: Sunny, Hot, Normal, Strong, PlayTennis = No What effect on earlier tree?

Overfitting Consider error of hypothesis h over training data: errortrain(h) entire distribution D of data: errorD(h) Hypothesis h ∈ H overfits training data if there is an alternative hypothesis h'∈ H such that errortrain(h) < errortrain(h') and errorD(h) > errorD(h')

Overfitting in Decision Tree Learning

Avoiding Overfitting How can we avoid overfitting? stop growing when data split not statistically significant grow full tree, then post-prune How to select “best” tree : Measure performance over training data Measure performance over separate validation data set MDL: minimize size(tree) + size(misclassifications(tree))

Reduced-Error Pruning Split data into training and validation set Do until further pruning is harmful: 1. Evaluate impact on validation set of pruning each possible node (plus those below it) 2. Greedily remove the one that most improves validation set accuracy produces smallest version of most accurate subtree What if data is limited?

Effect of Reduced-Error Pruning

Rule Post-Pruning 1. Convert tree to equivalent set of rules 2. Prune each rule independently of others 3. Sort final rules into desired sequence for use Perhaps most frequently used method (e.g., C4.5 )

Converting A Tree to Rules IF (Outlook = Sunny) ∧ (Humidity = High) THEN PlayTennis = No IF (Outlook = Sunny) ∧ (Humidity = Normal) THEN PlayTennis = Yes ….

Continuous Valued Attributes Create a discrete attribute to test continuous Temperature = 82.5 (Temperature > 72.3) = t, f

Attributes with Many Values Problem: If attribute has many values, Gain will select it Imagine using Date = Jun_3_1996 as attribute One approach : use GainRatio instead where Si is subset of S for which A has value vi

Attributes with Costs Consider medical diagnosis, BloodTest has cost $150 robotics, Width_from_1ft has cost 23 sec. How to learn a consistent tree with low expected cost? One approach: replace gain by Tan and Schlimmer (1990) Nunez (1988) where w ∈ [0,1] determines importance of cost

Unknown Attribute Values What if some examples missing values of A? Use training example anyway, sort through tree If node n tests A, assign most common value of A among other examples sorted to node n assign most common value of A among other examples with same target value assign probability pi to each possible value vi of A assign fraction pi of example to each descendant in tree Classify new examples in same fashion