CS 8751 ML & KDDDecision Trees1 Decision tree representation ID3 learning algorithm Entropy, Information gain Overfitting.

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
CPSC 502, Lecture 15Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 15 Nov, 1, 2011 Slide credit: C. Conati, S.
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
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 Trees Decision tree representation Top Down Construction
Data Mining with Decision Trees Lutz Hamel Dept. of Computer Science and Statistics University of Rhode Island.
Decision Trees IDHairHeightWeightLotionResult SarahBlondeAverageLightNoSunburn DanaBlondeTallAverageYesnone AlexBrownTallAverageYesNone AnnieBlondeShortAverageNoSunburn.
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
MACHINE LEARNING. What is learning? A computer program learns if it improves its performance at some task through experience (T. Mitchell, 1997) A computer.
Decision Tree Learning
Decision tree LING 572 Fei Xia 1/16/06.
For Monday No reading Homework: –Chapter 18, exercises 1 and 2.
Decision tree learning
By Wang Rui State Key Lab of CAD&CG
Fall 2004 TDIDT Learning CS478 - Machine Learning.
Machine Learning Chapter 3. Decision Tree 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.
Mohammad Ali Keyvanrad
For Wednesday No new reading Homework: –Chapter 18, exercises 3, 4, 7.
For Monday Read chapter 18, sections 5-6 Homework: –Chapter 18, exercises 1-2.
Decision tree learning Maria Simi, 2010/2011 Inductive inference with decision trees  Decision Trees is one of the most widely used and practical methods.
For Friday No reading No homework. Program 4 Exam 2 A week from Friday Covers 10, 11, 13, 14, 18, Take home due at the exam.
Machine Learning Lecture 10 Decision Tree Learning 1.
CpSc 810: Machine Learning Decision Tree Learning.
Learning from Observations Chapter 18 Through
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.
Decision Trees. What is a decision tree? Input = assignment of values for given attributes –Discrete (often Boolean) or continuous Output = predicated.
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 :  课程网页:
Decision Trees Binary output – easily extendible to multiple output classes. Takes a set of attributes for a given situation or object and outputs a yes/no.
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.
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.
Università di Milano-Bicocca Laurea Magistrale in Informatica
CS 9633 Machine Learning Decision Tree Learning
Decision Tree Learning
Machine Learning Lecture 2: Decision Tree Learning.
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:

CS 8751 ML & KDDDecision Trees1 Decision tree representation ID3 learning algorithm Entropy, Information gain Overfitting

CS 8751 ML & KDDDecision Trees2 Another Example Problem

CS 8751 ML & KDDDecision Trees3 A Decision Tree Type DoorsTires - Car Minivan SUV BlackwallWhitewall

CS 8751 ML & KDDDecision Trees4 Decision tree representation Each internal node tests an attribute Each branch corresponds to an attribute value Each leaf node assigns a classification How would you represent:

CS 8751 ML & KDDDecision Trees5 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

CS 8751 ML & KDDDecision Trees6 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 descendant of node 4. Divide training examples among child nodes 5. If training examples perfectly classified, STOP Else iterate over new leaf nodes Which attribute is best? A1 [29+,35 -] [8+,30 -] [21+,5 -] A2 [29+,35 -] [11+,2 -] [18+,33 -]

CS 8751 ML & KDDDecision Trees7 Entropy

CS 8751 ML & KDDDecision Trees8 Entropy Entropy(S) = expected number of bits need to encode class (+ or -) of randomly drawn member of S (using an optimal, shortest-length code) Why? Information theory: optimal length code assigns -log 2 p bits to message having probability p So, expected number of bits to encode + or - of random member of S:

CS 8751 ML & KDDDecision Trees9 Information Gain Gain(S,A) = expected reduction in entropy due to sorting on A A1 [29+,35 -] [8+,30 -] [21+,5 -] A2 [11+,2 -] [18+,33 -]

CS 8751 ML & KDDDecision Trees10 Car Examples Color Type Doors Tires Class Red SUV 2 Whitewall + Blue Minivan 4 Whitewall - Green Car 4 Whitewall - Red Minivan 4 Blackwall - Green Car 2 Blackwall + Green SUV 4 Blackwall - Blue SUV 2 Blackwall - Blue Car 2 Whitewall + Red SUV 2 Blackwall - Blue Car 4 Blackwall - Green SUV 4 Whitewall + Red Car 2 Blackwall + Green SUV 2 Blackwall - Green Minivan 4 Whitewall -

CS 8751 ML & KDDDecision Trees11 Selecting Root Attribute

CS 8751 ML & KDDDecision Trees12 Selecting Root Attribute (cont) Best attribute: Type (Gain = 0.200)

CS 8751 ML & KDDDecision Trees13 Selecting Next Attribute

CS 8751 ML & KDDDecision Trees14 Resulting Tree Type DoorsTires - Car Minivan SUV BlackwallWhitewall

CS 8751 ML & KDDDecision Trees15 Hypothesis Space Search by ID3

CS 8751 ML & KDDDecision Trees16 Hypothesis Space Search by ID3 Hypothesis space is complete! –Target function is in there (but will we find it?) Outputs a single hypothesis (which one?) –Cannot play 20 questions No back tracing –Local minima possible Statistically-based search choices –Robust to noisy data Inductive bias: approximately “prefer shortest tree”

CS 8751 ML & KDDDecision Trees17 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

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

CS 8751 ML & KDDDecision Trees19 Overfitting in Decision Trees Type DoorsTires - Car Minivan SUV BlackwallWhitewall Consider adding a noisy training example: + What happens to decision tree below?

CS 8751 ML & KDDDecision Trees20 Overfitting

CS 8751 ML & KDDDecision Trees21 Overfitting in Decision Tree Learning

CS 8751 ML & KDDDecision Trees22 Avoiding Overfitting How can we avoid overfitting? stop growing when data split not statistically significant grow full tree, the post-prune How to select “best” tree: Measure performance over training data Measure performance over separate validation set (examples from the training set that are put aside) MDL: minimize size(tree) + size(misclassifications(tree)

CS 8751 ML & KDDDecision Trees23 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?

CS 8751 ML & KDDDecision Trees24 Effect of Reduced-Error Pruning

CS 8751 ML & KDDDecision Trees25 Decision Tree Post-Pruning A standard method in C4.5, C5.0 Construct a complete tree –For each node estimate what the error might be with and without the node (needs a conservative estimate of error since based on training data) –Prune any node where the expected error stays the same or drops –Greatly influenced by method for estimating likely errors

CS 8751 ML & KDDDecision Trees26 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

CS 8751 ML & KDDDecision Trees27 Converting a Tree to Rules Type DoorsTires - Car Minivan SUV BlackwallWhitewall IF (Type=Car) AND (Doors=2) THEN + IF (Type=SUV) AND (Tires=Whitewall) THEN + IF (Type=Minivan) THEN - … (what else?)

CS 8751 ML & KDDDecision Trees28 Continuous Valued Attributes Create one (or more) corresponding discrete attributes based on continuous –(EngineSize = 325) = true or false –(EngineSize <= 330) = t or f (330 is “split” point) How to pick best “split” point? 1. Sort continuous data 2. Look at points where class differs between two values 3. Pick the split point with the best gain EngineSize: Class: Why this one?

CS 8751 ML & KDDDecision Trees29 Attributes with Many Values Problem: If attribute has many values, Gain will select it Imagine if cars had PurchaseDate feature - likely all would be different One approach: use GainRatio instead where S i is subset of S for which A has value v i

CS 8751 ML & KDDDecision Trees30 Attributes with Costs Consider medical diagnosis, BloodTest has cost $150 robotics, Width_from_1ft has cost 23 second How to learn consistent tree with low expected cost? Approaches: replace gain by Tan and Schlimmer (1990) Nunez (1988)

CS 8751 ML & KDDDecision Trees31 Unknown Attribute Values What if some examples missing values of A? “?” in C4.5 data sets 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 p i to each possible value v i of A assign fraction p i of example to each descendant in tree Classify new examples in same fashion