Docsity

Decision Trees - Machine Learning - Lecture Slides | CMPS 242, Study notes of Computer Science

Toggle sidebar
bg1
1
INTRODUCTION TO
Machine Learning
ETHEM ALPAYDIN
© The MIT Press, 2004
http://www.cmpe.boun.edu.tr/~ethem/i2ml
Lecture Slides for
CHAPTER 9:
Decision Trees
Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1)
3
Tree Uses Nodes, and Leaves
Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1)
4
Divide and Conquer
Internal decision nodes
Univariate: Uses a single attribute, xi
Numeric xi : Binary split : xi > wm
Discrete xi : n-way split for n possible values
Multivariate: Uses all attributes, x
Leaves
Classification: Class labels, or proportions
Regression: Numeric; r average, or local fit
Learning is greedy; find the best split recursively
(Breiman et al, 1984; Quinlan, 1986, 1993)
pf3
pf4
pf5

Partial preview of the text

Download Decision Trees - Machine Learning - Lecture Slides | CMPS 242 and more Study notes Computer Science in PDF only on Docsity!

INTRODUCTION TO

Machine Learning

ETHEM ALPAYDIN

© The MIT Press, 2004 [email protected] http://www.cmpe.boun.edu.tr/~ethem/i2ml

Lecture Slides for

CHAPTER 9:

Decision Trees

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 3

Tree Uses Nodes, and Leaves

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 4

Divide and Conquer

 Internal decision nodes  Univariate: Uses a single attribute, xi  Numeric xi : Binary split : xi > wm  Discrete xi : n -way split for n possible values  Multivariate: Uses all attributes, x  Leaves  Classification: Class labels, or proportions  Regression: Numeric; r average, or local fit  Learning is greedy; find the best split recursively (Breiman et al, 1984; Quinlan, 1986, 1993)

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 5 High level  Want small tree fitting data for good generalization  Occam’s razor (simplest hypothesis consistent with data is best)  Distinguish real world from all possible situations vs. Distinguish real world from all simpler situations  N data points, d real valued attributes, k nodes:  ~dN many different attribute < value tests  ( dN ) k^ many trees -- too many to search  Use greedy top-down search Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 6 Classification Trees (ID3, CART, C4.5)  For node m , Nm instances reach m , Nim belong to Ci  Node m is pure if pim is 0 or 1  Measure of impurity is entropy ( ) m i i mi^ m N

N

Pˆ^ C | x,m! p = ! =

K i i m i

m p m p

1

I log 2

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 7 Best Split  If node m is pure, generate a leaf and stop, otherwise split and continue recursively  Impurity after split: Nmj of Nm take branch j. Nimj belong to Ci  Find the variable and split that min impurity (among all variables -- and split positions for numeric variables) ( ) mj i i^ mj i mj N

N

ˆP (^) C | x,m,j! p = !! = =

K i i mj i mj n j (^) m mj m (^) N p p

N

1 2 1 I' log Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 8

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 13 Learning Rules  Rule induction is similar to tree induction but  tree induction is breadth-first,  rule induction is depth-first; one rule at a time  Rule set contains rules; rules are conjunctions of terms  Rule covers an example if all terms of the rule evaluate to true for the example  Sequential covering: Generate rules one at a time until all positive examples are covered  IREP (Fürnkrantz and Widmer, 1994), Ripper (Cohen, 1995) Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 14 Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 15 Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 16 Multivariate Trees

Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 17 Random Forests  Pick small random subset of features to try at each node rather than exhaustive search  Build many trees and predict with most frequent prediction  Subset saves time, robust against missing data  Ensemble reduces variance - don’t need pruning  Ho ‘95, Brieman ‘ 01