M chi h n i e n L e L arni n n i g Decision Trees Mac a h c i h n i e n e L e L a e r a ni n ng

Similar documents
Decision Tree Learning

Decision Tree Learning Mitchell, Chapter 3. CptS 570 Machine Learning School of EECS Washington State University

Lecture 3: Decision Trees

Decision-Tree Learning. Chapter 3: Decision Tree Learning. Classification Learning. Decision Tree for PlayTennis

Chapter 3: Decision Tree Learning

Decision Tree Learning

Learning Decision Trees

Learning Decision Trees

CS 6375 Machine Learning

Administration. Chapter 3: Decision Tree Learning (part 2) Measuring Entropy. Entropy Function

Introduction. Decision Tree Learning. Outline. Decision Tree 9/7/2017. Decision Tree Definition

Lecture 3: Decision Trees

Decision Trees.

Question of the Day. Machine Learning 2D1431. Decision Tree for PlayTennis. Outline. Lecture 4: Decision Tree Learning

Outline. Training Examples for EnjoySport. 2 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997

CS6375: Machine Learning Gautam Kunapuli. Decision Trees

Decision Trees. Data Science: Jordan Boyd-Graber University of Maryland MARCH 11, Data Science: Jordan Boyd-Graber UMD Decision Trees 1 / 1

Decision Trees.

Decision Tree Learning and Inductive Inference

Supervised Learning! Algorithm Implementations! Inferring Rudimentary Rules and Decision Trees!

DECISION TREE LEARNING. [read Chapter 3] [recommended exercises 3.1, 3.4]

the tree till a class assignment is reached

Machine Learning & Data Mining

Learning Classification Trees. Sargur Srihari

Dan Roth 461C, 3401 Walnut

Classification and Prediction

Chapter 3: Decision Tree Learning (part 2)

Machine Learning 2nd Edi7on

Notes on Machine Learning for and

Classification: Decision Trees

Decision Trees. Tirgul 5

Decision Trees / NLP Introduction

Decision Tree Learning

Typical Supervised Learning Problem Setting

Decision trees. Special Course in Computer and Information Science II. Adam Gyenge Helsinki University of Technology

Apprentissage automatique et fouille de données (part 2)

Decision Tree Learning - ID3

Induction of Decision Trees

Introduction to ML. Two examples of Learners: Naïve Bayesian Classifiers Decision Trees

Information Theory & Decision Trees

Decision Tree Learning

CS145: INTRODUCTION TO DATA MINING

Introduction to Machine Learning CMU-10701

Decision Tree. Decision Tree Learning. c4.5. Example

EECS 349:Machine Learning Bryan Pardo

Decision Tree Analysis for Classification Problems. Entscheidungsunterstützungssysteme SS 18

ML techniques. symbolic techniques different types of representation value attribute representation representation of the first order

Classification Using Decision Trees


Universität Potsdam Institut für Informatik Lehrstuhl Maschinelles Lernen. Intelligent Data Analysis. Decision Trees

Imagine we ve got a set of data containing several types, or classes. E.g. information about customers, and class=whether or not they buy anything.

Algorithms for Classification: The Basic Methods

Classification and regression trees

Decision Trees. CS57300 Data Mining Fall Instructor: Bruno Ribeiro

CS 380: ARTIFICIAL INTELLIGENCE MACHINE LEARNING. Santiago Ontañón

Decision Tree Learning

Machine Learning Recitation 8 Oct 21, Oznur Tastan

Data Mining. CS57300 Purdue University. Bruno Ribeiro. February 8, 2018

Rule Generation using Decision Trees

Decision Trees. Gavin Brown

Data classification (II)

Einführung in Web- und Data-Science

Machine Learning 2010

Decision Tree Learning

2018 CS420, Machine Learning, Lecture 5. Tree Models. Weinan Zhang Shanghai Jiao Tong University

CSCI 5622 Machine Learning

Decision Trees. Each internal node : an attribute Branch: Outcome of the test Leaf node or terminal node: class label.

Decision Trees Part 1. Rao Vemuri University of California, Davis

Decision Trees. Danushka Bollegala

Classification II: Decision Trees and SVMs

Decision Tree Learning Lecture 2

Lecture 7: DecisionTrees

Lecture 24: Other (Non-linear) Classifiers: Decision Tree Learning, Boosting, and Support Vector Classification Instructor: Prof. Ganesh Ramakrishnan

Introduction Association Rule Mining Decision Trees Summary. SMLO12: Data Mining. Statistical Machine Learning Overview.

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

Inductive Learning. Chapter 18. Material adopted from Yun Peng, Chuck Dyer, Gregory Piatetsky-Shapiro & Gary Parker

Machine Learning 3. week

Classification: Decision Trees

Data Mining Classification: Basic Concepts, Decision Trees, and Model Evaluation

[read Chapter 2] [suggested exercises 2.2, 2.3, 2.4, 2.6] General-to-specific ordering over hypotheses

Artificial Intelligence. Topic

Tutorial 6. By:Aashmeet Kalra

Decision Trees. Machine Learning 10701/15781 Carlos Guestrin Carnegie Mellon University. February 5 th, Carlos Guestrin 1

The Quadratic Entropy Approach to Implement the Id3 Decision Tree Algorithm

Classification: Rule Induction Information Retrieval and Data Mining. Prof. Matteo Matteucci

Classification and Regression Trees

Symbolic methods in TC: Decision Trees

Decision Trees. CSC411/2515: Machine Learning and Data Mining, Winter 2018 Luke Zettlemoyer, Carlos Guestrin, and Andrew Moore

( D) I(2,3) I(4,0) I(3,2) weighted avg. of entropies

Lecture 9: Bayesian Learning

Decision Trees Entropy, Information Gain, Gain Ratio

Data Mining Classification: Basic Concepts and Techniques. Lecture Notes for Chapter 3. Introduction to Data Mining, 2nd Edition

CSCE 478/878 Lecture 6: Bayesian Learning

Jialiang Bao, Joseph Boyd, James Forkey, Shengwen Han, Trevor Hodde, Yumou Wang 10/01/2013

CSE 417T: Introduction to Machine Learning. Final Review. Henry Chai 12/4/18

Decision Trees. Lewis Fishgold. (Material in these slides adapted from Ray Mooney's slides on Decision Trees)

CSC 411 Lecture 3: Decision Trees

UVA CS 4501: Machine Learning

Decision Tree And Random Forest

brainlinksystem.com $25+ / hr AI Decision Tree Learning Part I Outline Learning 11/9/2010 Carnegie Mellon

Transcription:

1 Decision Trees

2 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 Risk analysis Credit, loans Insurance Consumer fraud Employee fraud When to Consider Using Decision Trees Modeling calendar scheduling preferences (predicting quality of candidate time) Instances Usually Represented Using Discrete Valued Attributes Typical types Nominal ({red, yellow, green}) Quantized ({low, medium, high}) Handling numerical values Discretization, a form of vector quantization (e.g., histogramming) Using thresholds for splitting nodes

Decision Trees and Decision Boundaries 3 Decision tree divides the Instance Space into Axis-Parallel Rectangles y 7 + + + No x < 3? 5 + + - y > 7? y < 5? No No - + - - + + x < 1? No 1 3 x + -

Decision Tree Learning: Top-Down Induction (ID ID3) 4 Algorithm Build-DT (Examples, Attributes) IF all examples have the same label THEN RETURN (leaf node with label) ELSE IF set of attributes is empty THEN RETURN (leaf with majority label) ELSE Choose best attribute A as root FOR each value v of A Create a branch out of the root for the condition A = v IF {x Examples: x.a = v} = Ø THEN RETURN (leaf with majority label) ELSE Build-DT ({x Examples: x.a = v}, Attributes ~ {A}) But Which Attribute Is Best? [29+, 35-] [29+, 35-] A 1 A 2 True False True False [21+, 5-] [8+, 30-] [18+, 33-] [11+, 2-]

5 Assumptions in Previous Algorithm Discrete output Applicability of Decision Trees Real-valued outputs are possible Regression trees [Breiman et al, 1984] Discrete input Scaling Up Quantization methods Inequalities at nodes instead of equality tests (see rectangle example) Critical in knowledge discovery and database mining (KDD) from very large databases (VLDB) Good news: efficient algorithms exist for processing many examples Bad news: much harder when there are too many attributes Other Desired Tolerances Noisy data (classification noise incorrect labels; attribute noise inaccurate or imprecise data) Missing attribute values

6 Objective Choosing the Best Root Attribute Construct a decision tree that is a small as possible (Occam s Razor) Subject to: consistency with labels on training data Obstacles Finding the minimal consistent hypothesis (i.e., decision tree) is NP-hard Recursive algorithm (Build-DT) A greedy heuristic search for a simple tree Cannot guarantee optimality Main Decision: Next Attribute to Condition On Want: attributes that split examples into sets that are relatively pure in one label Result: closer to a leaf node Most popular heuristic Developed by J. R. Quinlan Based on information gain Used in ID3 algorithm

7 A Measure of Uncertainty The Quantity Purity: how close a set of instances is to having just one label Impurity (disorder): how close it is to total uncertainty over labels The Measure: Entropy Directly proportional to impurity, uncertainty, irregularity, surprise Inversely proportional to purity, certainty, regularity, redundancy Example Entropy: Intuitive Notion For simplicity, assume H = {0, 1}, distributed according to Pr(y) Can have (more than 2) discrete class labels Continuous random variables: differential entropy Optimal purity for y: either Pr(y = 0) = 1, Pr(y = 1) = 0 Pr(y = 1) = 1, Pr(y = 0) = 0 What is the least pure probability distribution? Pr(y = 0) = 0.5, Pr(y = 1) = 0.5 Corresponds to maximum impurity/uncertainty/irregularity/surprise Property of entropy: concave function ( concave downward ) H(p) = Entropy(p) 1.0 0.5 1.0 p + = Pr(y = +)

8 Components Entropy: Information Theoretic Definition D: a set of examples {<x 1, c(x 1 )>, <x 2, c(x 2 )>,, <x m, c(x m )>} p + = Pr(c(x) = +), p - = Pr(c(x) = -) Definition H is defined over a probability density function p D contains examples whose frequency of + and - labels indicates p + and p - for the observed data The entropy of D relative to c is: H(D) -p + log b (p + ) - p - log b (p - ) What Units is H Measured In? Depends on the base b of the log (bits for b = 2, nats for b = e, etc.) A single bit is required to encode each example in the worst case (p + = 0.5) If there is less uncertainty (e.g., p + = 0.8), we can use less than 1 bit each

9 Partitioning on Attribute Values Information Gain: Information Theoretic Definition Recall: a partition of D is a collection of disjoint subsets whose union is D Goal: measure the uncertainty removed by splitting on the value of attribute A Definition The information gain of D relative to attribute A is the expected reduction in entropy due to splitting ( sorting ) on A: Gain v ( D,A) - H( D) H( D ) where D v is {x D: x.a = v}, the set of examples in D where attribute A has value v Idea: partition on A; scale entropy to the size of each subset D v Which Attribute Is Best? v values(a) D D v [29+, 35-] [29+, 35-] A 1 A 2 True False True False [21+, 5-] [8+, 30-] [18+, 33-] [11+, 2-]

10 Training Examples for Concept PlayTennis An Illustrative Example Day Outlook Temperature Humidity Wind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain Mild High Light 5 Rain Cool Normal Light 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong 8 Sunny Mild High Light No 9 Sunny Cool Normal Light 10 Rain Mild Normal Light 11 Sunny Mild Normal Strong 12 Overcast Mild High Strong 13 Overcast Hot Normal Light 14 Rain Mild High Strong No ID3 Build-DT using Gain( ) How Will ID3 Construct A Decision Tree?

11 Selecting The Root Attribute Constructing A Decision Tree for PlayTennis using ID3 [1] Day Outlook Temperature Humidity Wind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain Mild High Light 5 Rain Cool Normal Light 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong 8 Sunny Mild High Light No 9 Sunny Cool Normal Light 10 Rain Mild Normal Light 11 Sunny Mild Normal Strong 12 Overcast Mild High Strong 13 Overcast Hot Normal Light 14 Rain Mild High Strong No [9+, 5-] Humidity High Normal [3+, 4-] [6+, 1-] [9+, 5-] Wind Light Strong Prior (unconditioned) distribution: 9+, 5- H(D) = -(9/14) lg (9/14) - (5/14) lg (5/14) bits = 0.94 bits H(D, Humidity = High) = -(3/7) lg (3/7) - (4/7) lg (4/7) = 0.985 bits H(D, Humidity = Normal) = -(6/7) lg (6/7) - (1/7) lg (1/7) = 0.592 bits Gain(D, Humidity) = 0.94 - (7/14) * 0.985 - (7/14) * 0.592 = 0.151 bits Similarly, Gain (D, Wind) = 0.94 - (8/14) * 0.811 + (6/14) * 1.0 = 0.048 bits Gain v ( D,A) - H( D) H( D ) v values(a) D D v [6+, 2-] [3+, 3-]

12 Selecting The Root Attribute Constructing A Decision Tree for PlayTennis using ID3 [2] Day Outlook Temperature Humidity Wind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain Mild High Light 5 Rain Cool Normal Light 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong 8 Sunny Mild High Light No 9 Sunny Cool Normal Light 10 Rain Mild Normal Light 11 Sunny Mild Normal Strong 12 Overcast Mild High Strong 13 Overcast Hot Normal Light 14 Rain Mild High Strong No Gain(D, Humidity) = 0.151 bits Gain(D, Wind) = 0.048 bits Gain(D, Temperature) = 0.029 bits Gain(D, Outlook) = 0.246 bits Selecting The Next Attribute (Root of Subtree) Continue until every example is included in path or purity = 100% What does purity = 100% mean? Can Gain(D, A) < 0? [2+, 3-] [9+, 5-] Sunny Outlook Overcast [4+, 0-] Rain [3+, 2-]

Constructing A Decision Tree for PlayTennis using ID3 [3] 13 Selecting The Next Attribute (Root of Subtree) Day Outlook Temperature Humidity Wind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain Mild High Light 5 Rain Cool Normal Light 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong 8 Sunny Mild High Light No 9 Sunny Cool Normal Light 10 Rain Mild Normal Light 11 Sunny Mild Normal Strong 12 Overcast Mild High Strong 13 Overcast Hot Normal Light 14 Rain Mild High Strong No Convention: lg (0/a) = 0 Gain(D Sunny, Humidity) = 0.97 - (3/5) * 0 - (2/5) * 0 = 0.97 bits Gain(D Sunny, Wind) = 0.97 - (2/5) * 1 - (3/5) * 0.92 = 0.02 bits Gain(D Sunny, Temperature) = 0.57 bits Top-Down Induction For discrete-valued attributes, terminates in Ο(n) splits Makes at most one pass through data set at each level (why?)

14 Constructing A Decision Tree for PlayTennis using ID3 [4] Day Outlook Tem perature Hum idity W ind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain M ild High Light 5 Rain Cool Norm al Light 6 Rain Cool Norm al Strong No 7 Overcast Cool Norm al Strong 8 Sunny M ild High Light No 9 Sunny Cool Norm al Light 10 Rain M ild Norm al Light 11 Sunny M ild Norm al Strong 12 Overcast M ild High Strong 13 Overcast Hot Norm al Light 14 Rain M ild High Strong No 1,2,3,4,5,6,7,8,9,10,11,12,13,14 [9+,5-] Outlook? 1,2,8,9,11 [2+,3-] High Humidity? Sunny Overcast Rain Normal 3,7,12,13 [4+,0-] Strong Wind? Light 4,5,6,10,14 [3+,2-] No No 1,2,8 [0+,3-] 9,11 [2+,0-] 6,14 [0+,2-] 4,5,10 [3+,0-]

15 Search Problem Hypothesis Space Search by ID3 Conduct a search of the space of decision trees, which can represent all possible discrete functions Objective: to find the best decision tree (minimal consistent tree) Obstacle: finding this tree is NP-hard Tradeoff Use heuristic (figure of merit that guides search) Use greedy algorithm (gradient descent ) without backtracking Search Space and Search Strategy of ID3 Hypothesis space of ID3 contains a complete space of finite discrete valued functions. ID3 maintains only a single current hypothesis as it searches through the space of decision trees. Cannot represent all consistent hypothesis no incremental algorithm. ID3 uses greedy algorithm Locally Optimal. ID3 uses all training data at each step in the search to make statistically based decisions. Robust to noisy data.............

16 Types of Biases Preference (Search) Bias Put priority on choosing hypothesis Inductive Bias in ID3 Encoded in learning algorithm -> Compare: search heuristic For ex. ID3 has this type of bias. Language Bias Put restriction on the set of hypotheses considered Encoded in knowledge (hypothesis) representation Compare: restriction of search space For ex. Candidate-Elimination has this type of bias. Which Bias is better? Preference bias is more desirable. Because, the learner works within a complete space that is assured to contain the unknown concept. Inductive Bias of ID3 Shorter trees are preferred over longer trees. Occam s razor : Prefer the simplest hypothesis that fits the data. Trees that place high information gain attributes close to the root are preferred over those that do not.

Over-fitting in Decision Trees 17 Recall: Induced Tree 1,2,3,4,5,6,7,8,9,10,11,12,13,14 [9+,5-] High Normal Outlook? 1,2,8,9,11 Sunny Overcast Rain [2+,3-] Humidity? Wind? 3,7,12,13 [4+,0-] Strong 4,5,6,10,14 [3+,2-] Light Boolean Decision Tree for Concept PlayTennis No Temp? No 1,2,8 9,11,15 6,14 4,5,10 [0+,3-] [2+,1-] [0+,2-] [3+,0-] Hot Mild Cool 15 [0+,1-] No Noisy Training Example 11 [1+,0-] How shall the DT be revised (incremental learning)? Example 15: <Sunny, Hot, Normal, Strong, -> Example is noisy because the correct label is + Previously constructed tree misclassifies it 9 [1+,0-] New hypothesis h = T is expected to perform worse than h = T 1,2,8,9,11 Humidity? [2+,3-] H No 1,2,8 [0+,3-] N S 9,11 [2+,0-] Outlook? O 3,7,12,13 [4+,0-] No R Wind? 4,5,6,10 [3+,2- S 6,14 [0+,2-] L 4,5,10 [3+,0-]

Overfitting in Inductive Learning 18 Definition : Hypothesis h overfits training data set D if there exists an alternative hypothesis h such that error D (h) < error D (h ) but error test (h) > error test (h ) Causes decisions based on too little data or noisy data How can we avoid over-fitting? Prevention Stop training (growing) before it reaches the point that overfits. Select attributes that are relevant (i.e., will be useful in the decision tree) requires some predictive measure of relevance Avoidance Allow to over-fit, then improve the generalization capability of the tree. Holding out a validation set (test set) Detection and Recovery Letting the problem happen, detecting when it does, recovering afterward Build model, remove (prune) elements that contribute to overfitting How to Select Best Tree? Training and Validation Set Use a separate set of examples (distinct from the training set) for test. Statistical Test Use all data for training, but apply the statistical test to estimate the over-fitting. Define the measure of complexity Halting the grow when this measure is minimized.

19 Two Basic Approaches Pre-pruning (avoidance): stop growing tree at some point during construction when it is determined that there is not enough data to make reliable choices Preventing overfitting Post-pruning (recovery): grow the full tree and then remove nodes that seem not to have sufficient evidence Accuracy 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5 0 10 20 30 40 50 60 70 80 90 100 Size of tree (number of nodes) On training data On test data error true error training error Number of nodes in tree

20 Post-Pruning, Cross-Validation Approach Split Data into Training and Validation Sets Function Prune(T, node) Remove the subtree rooted at node Make node a leaf (with majority label of associated examples) Algorithm Reduced-Error-Pruning (D) Reduced-Error Pruning Partition D into D train (training / growing ), D validation (validation / pruning ) Build complete tree T using ID3 on D train UNTIL accuracy on D validation decreases DO FOR each non-leaf node candidate in T Temp[candidate] Prune (T, candidate) Accuracy[candidate] Test (Temp[candidate], D validation ) T T Temp with best value of Accuracy (best increase; greedy) RETURN (pruned) T Drawbacks Data is limited Accuracy 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5 0 10 20 30 40 50 60 70 80 90 100 Size of tree (number of nodes) On training data On test data Post-pruned tree on test data

21 Frequently Used Method Rule Post-PruningPruning Popular anti-overfitting method; perhaps most popular pruning method Variant used in C4.5, an outgrowth of ID3 Algorithm Rule-Post-Pruning (D) Infer T from D (using ID3) - grow until D is fit as well as possible (allow overfitting) Convert T into equivalent set of rules (one for each root-to-leaf path) Prune (generalize) each rule independently by deleting any preconditions whose deletion improves its estimated accuracy Sort the pruned rules Sort by their estimated accuracy Apply them in sequence on D test Rule Syntax LHS: precondition (conjunctive formula over attribute equality tests) RHS: class label Example IF (Outlook = Sunny) (Humidity = High) THEN PlayTennis = No IF (Outlook = Sunny) (Humidity = Normal) THEN PlayTennis = Sunny Outlook? Overcast Rain Humidity? Wind? High Normal Strong Light No No

Pruning Algorithms 22 Reduced Error Pruning Pessimistic Error Pruning Minimum Error Pruning Critical Value Pruning Cost-Complexity Pruning Reading F. Esposito, D. Malerba, and G. Semeraro, A Comparative Analysis of Methods for Pruning Decision Trees, IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol. 19, No. 5, pp. 476-491, May 1997. S. R. Safavian and D. Landgrebe, A Survey of Decision Tree Classifier Methodology, IEEE Trans on Systems, Man, and Cybernetics, Vol. 21, No. 3, pp. 660-674, 1991.

23 Continuous Valued Attributes Two Methods for Handling Continuous Attributes Discretization (e.g., histogramming) Break real-valued attributes into ranges in advance e.g., {high Temp > 35º C, med 10º C < Temp 35º C, low Temp 10º C} Using thresholds for splitting nodes e.g., A a produces subsets A a and A > a Information gain is calculated the same way as for discrete splits How to Find the Split with Highest Gain? FOR each continuous attribute A Divide examples {x D} according to x.a FOR each ordered pair of values (l, u) of A with different labels Example Evaluate gain of mid-point as a possible threshold, i.e., D A (l+u)/2, D A > (l+u)/2 A Length: 10 15 21 28 32 40 50 Class: - + + - + + - Check thresholds: Length 12.5? 24.5? 30? 45?

24 Missing Data: Unknown Attribute Values Problem: What If Some Examples Missing Values of A? Often, values not available for all attributes during training or testing Example: medical diagnosis <Fever = true, Blood-Pressure = normal,, Blood-Test =?, > Sometimes values truly unknown, sometimes low priority (or cost too high) Missing values in learning versus classification Training: evaluate Gain (D, A) where for some x D, a value for A is not given Testing: classify a new example x without knowing the value of A Solutions: Incorporating a Guess into Calculation of Gain(D, A) Day Outlook Temperature Humidity Wind PlayTennis? 1 Sunny Hot High Light No 2 Sunny Hot High Strong No 3 Overcast Hot High Light 4 Rain Mild High Light 5 Rain Cool Normal Light 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong 8 Sunny Mild??? Light No 9 Sunny Cool Normal Light 10 Rain Mild Normal Light 11 Sunny Mild Normal Strong 12 Overcast Mild High Strong 13 Overcast Hot Normal Light 14 Rain Mild High Strong No [9+, 5-] Outlook Sunny Overcast [2+, 3-] [4+, 0-] Rain [3+, 2-]

25 Regression Tree A regression tree is constructed in almost the same manner as classification tree, except that appropriate impurity measure for regression is used. Let X m be a subset of X reaching node m. In regression tree, the goodness of a split is measured by the mean square error from the estimated value. A 1 True F 1 (A-A 1 )] False F[11+, 2 (A-A2-] 1 )] Reading L. Breiman, J. H. Friedman, R. A. Olshen, and C. J. Stone, Classification and Regression Trees, Belmont, CA; Wadsworth International Group, (1984). D. Malerba, F. Esposito, M. Ceci, and A. Appice, Top-Down Induction of Model Trees with Regression and Splitting Nodes, IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol. 25, No. 5, pp. 612-625, May 2004.

26 Decision Trees Univariate Trees In univariate trees, the test at each internal node just uses only one of input attributes. Multivariate Trees In multivariate trees, the test at each internal node can use all input attributes. For example: Consider a data set with numerical attributes. The test can be made using the weighted linear combination of some input attributes. For example X=(x 1,x 2 ) be the input attributes. Let f (X)=w 0 +w 1 x 1 +w 2 x 2 can be used for test at an internal node. Such as f (x) > 0. (w 0 +w 1 x 1 +w 2 x 2 )>0 True False YES [11+, NO2-] Reading C. E. Brodley and P. E. Utgoff, Multivariate Decision Trees,, Vol. 19, pp. 45-77, 1995.

Incremental Learning of Decision Trees 27 ID3 can not be trained incrementally. ID4, ID5, ID5R are samples of incremental induction of decision trees Reading P.E. Utgoff, Incremental Induction of Decision Trees,, Vol. 4, pp. 161-186,1989. [9+,5-] Outlook? Sunny Overcast Rain [2+,3-] Humidity? Wind? [3+,2-] High Normal [4+,0-] Strong Light No No [0+,3-] [2+,0-] [0+,2-] [3+,0-]

28 Problem Attributes with Many Values If attribute has many values, Gain( ) will select it (why?) Imagine using Date = 06/03/1996 as an attribute! One Approach: Use GainRatio instead of Gain Gain GainRatio v ( D,A) - H( D) H( D ) ( D,A ) i.e., penalizes attributes with more values e.g., suppose c 1 = c Date = n and c 2 = 2 v values(a) D D ( D,A) ( D,A) Gain SplitInformation Dv Dv ( ) SplitInformation D,A lg v values(a) D D SplitInformation: directly proportional to c = values(a) SplitInformation (A 1 ) = lg(n), SplitInformation (A 2 ) = 1 If Gain(D, A 1 ) = Gain(D, A 2 ), GainRatio (D, A 1 ) << GainRatio (D, A 2 ) Thus, preference bias (for lower branch factor) expressed via GainRatio( ) v

29 Alternative Attribute Selection : Gini Index [1] If a data set D contains examples from n classes, gini index, gini(d) is defined as n gini ( D ) = 1 p 2 j j = 1 where p j is the relative frequency of class j in D If a data set D is split on A into two subsets D 1 and D 2, the gini index gini(d) is defined as D 1 D 2 gini A ( D) = gini ( D 1) + gini ( D 2 Reduction in Impurity: D D gini( A) = gini( D) gini ( D) The attribute provides the smallest gini split (D) (or the largest reduction in impurity) is chosen to split the node (need to enumerate all the possible splitting points for each attribute) A )

Handling Attributes With Different Costs 30 In some learning tasks the instance attributes may have associated costs. We prefer decision trees that use low cost attributes where possible, relying on high cost attributes only when needed to produce reliable classifications. Solutions Extended ID3 Tan and Schlimmer Gain( S, A) Cost( ( A) ) 2 Gain ( S, A) Cost( A) Nunez Gain ( S, A) 2 1 ( Cost ( A) + 1) w where w [0,1] is a constant

References 31 P.E. Utgoff, Incremental Induction of Decision Trees,, Vol. 4, pp. 161-186,1989. D. Malerba, F. Esposito, M. Ceci, and A. Appice, Top-Down Induction of Model Trees with Regression and Splitting Nodes, IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol. 25, No. 5, pp. 612-625, May 2004. F. Esposito, D. Malerba, and G. Semeraro, A Comparative Analysis of Methods for Pruning Decision Trees, IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol. 19, No. 5, pp. 476-491, May 1997. S. R. Safavian and D. Landgrebe, A Survey of Decision Tree Classifier Methodology, IEEE Trans on Systems, Man, and Cybernetics, Vol. 21, No. 3, pp. 660-674. S. K. Murthy, Automatic Construction of Decision Trees from Data: A Multi- Disciplinary Survey, Data Mining and Knowledge Discovery, Vol. 2, pp. 345 389 1998.