DOC PREVIEW
CMU CS 10701 - decisiontrees

This preview shows page 1-2-3-24-25-26-27-49-50-51 out of 51 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

©2005-2007 Carlos Guestrin1Decision TreesMachine Learning – 10701/15781Carlos GuestrinCarnegie Mellon UniversityFebruary 5th, 2007©2005-2007 Carlos Guestrin2Linear separability A dataset is linearly separable iff 9 aseparating hyperplane: 9 w, such that: w0 + ∑i wi xi > 0; if x={x1,…,xn} is a positive example w0 + ∑i wi xi < 0; if x={x1,…,xn} is a negative example©2005-2007 Carlos Guestrin3Not linearly separable data Some datasets are not linearly separable!©2005-2007 Carlos Guestrin4Addressing non-linearly separabledata – Option 1, non-linear features Choose non-linear features, e.g., Typical linear features: w0 + ∑i wi xi Example of non-linear features: Degree 2 polynomials, w0 + ∑i wi xi + ∑ij wij xi xj Classifier hw(x) still linear in parameters w As easy to learn Data is linearly separable in higher dimensional spaces More discussion later this semester©2005-2007 Carlos Guestrin5Addressing non-linearly separabledata – Option 2, non-linear classifier Choose a classifier hw(x) that is non-linear in parameters w, e.g., Decision trees, neural networks, nearest neighbor,… More general than linear classifiers But, can often be harder to learn (non-convex/concaveoptimization required) But, but, often very useful (BTW. Later this semester, we’ll see that these options are notthat different)©2005-2007 Carlos Guestrin6A small dataset: Miles Per GallonFrom the UCI repository (thanks to Ross Quinlan)40 Recordsmpg cylinders displacement horsepower weight acceleration modelyear makergood 4 low low low high 75to78 asiabad 6 medium medium medium medium 70to74 americabad 4 medium medium medium low 75to78 europebad 8 high high high low 70t o74 americabad 6 medium medium medium medium 70to74 americabad 4 low medium low medium 70to74 asiabad 4 low medium low low 70t o74 asiabad 8 high high high low 75t o78 america: : : : : : : :: : : : : : : :: : : : : : : :bad 8 high high high low 70t o74 americagood 8 high medium high high 79to83 americabad 8 high high high low 75t o78 americagood 4 low low low low 79t o83 americabad 6 medium medium medium high 75to78 americagood 4 medium low low low 79t o83 americagood 4 low low medium high 79to83 americabad 8 high high high low 70t o74 americagood 4 low medium low medium 75to78 europebad 5 medium medium medium medium 75to78 europeSuppose we want topredict MPG©2005-2007 Carlos Guestrin7A Decision Stump©2005-2007 Carlos Guestrin8Recursion StepTake theOriginalDataset..And partition itaccordingto the value ofthe attributewe split onRecordsin whichcylinders= 4Recordsin whichcylinders= 5Recordsin whichcylinders= 6Recordsin whichcylinders= 8©2005-2007 Carlos Guestrin9Recursion StepRecords inwhichcylinders = 4Records inwhichcylinders = 5Records inwhichcylinders = 6Records inwhichcylinders = 8Build tree fromThese records..Build tree fromThese records..Build tree fromThese records..Build tree fromThese records..©2005-2007 Carlos Guestrin10Second level of treeRecursively build a tree from the sevenrecords in which there are four cylinders andthe maker was based in Asia(Similar recursion in theother cases)©2005-2007 Carlos Guestrin11The final tree©2005-2007 Carlos Guestrin12Classification of a new example Classifying a testexample – traverse treeand report leaf label©2005-2007 Carlos Guestrin13Are all decision trees equal? Many trees can represent the same concept But, not all trees will have the same size! e.g., φ = AÆB ∨ ¬ AÆC ((A and B) or (not A and C))©2005-2007 Carlos Guestrin14Learning decision trees is hard!!! Learning the simplest (smallest) decision tree isan NP-complete problem [Hyafil & Rivest ’76] Resort to a greedy heuristic: Start from empty decision tree Split on next best attribute (feature) Recurse©2005-2007 Carlos Guestrin15Choosing a good attributeTTTTFTFFFFTFFFFTTFTFTTTTYX2X1©2005-2007 Carlos Guestrin16Measuring uncertainty Good split if we are more certain aboutclassification after split Deterministic good (all true or all false) Uniform distribution badP(Y=C) = 1/4P(Y=B) = 1/4 P(Y=D) = 1/4P(Y=A) = 1/4P(Y=C) = 1/8P(Y=B) = 1/4 P(Y=D) = 1/8P(Y=A) = 1/2©2005-2007 Carlos Guestrin17EntropyEntropy H(X) of a random variable YMore uncertainty, more entropy!Information Theory interpretation: H(Y) is the expected number of bits neededto encode a randomly drawn value of Y (under most efficient code)©2005-2007 Carlos Guestrin18Andrew Moore’s Entropy in a nutshellLow Entropy High Entropy©2005-2007 Carlos Guestrin19Low Entropy High Entropy..the values (locations ofsoup) unpredictable...almost uniformly sampledthroughout our dining room..the values (locationsof soup) sampledentirely from withinthe soup bowlAndrew Moore’s Entropy in a nutshell©2005-2007 Carlos Guestrin20Information gain Advantage of attribute – decrease in uncertainty Entropy of Y before you split Entropy after split Weight by probability of following each branch, i.e.,normalized number of records Information gain is differenceTTTTFTFFFTTFTFTTTTYX2X1©2005-2007 Carlos Guestrin21Learning decision trees Start from empty decision tree Split on next best attribute (feature) Use, for example, information gain to select attribute Split on Recurse©2005-2007 Carlos Guestrin22Look at all theinformationgains…Suppose we want topredict MPG©2005-2007 Carlos Guestrin23A Decision Stump©2005-2007 Carlos Guestrin24Base CaseOneDon’t split anode if allmatchingrecords havethe sameoutput value©2005-2007 Carlos Guestrin25Base CaseTwoDon’t split anode if noneof theattributescan createmultiple non-emptychildren©2005-2007 Carlos Guestrin26Base Case Two:No attributescan distinguish©2005-2007 Carlos Guestrin27Base Cases Base Case One: If all records in current data subset have the sameoutput then don’t recurse Base Case Two: If all records have exactly the same set of inputattributes then don’t recurse©2005-2007 Carlos Guestrin28Base Cases: An idea Base Case One: If all records in current data subset have the sameoutput then don’t recurse Base Case Two: If all records have exactly the same set of inputattributes then don’t recurseProposed Base Case 3:If all attributes have zero informationgain then don’t recurse•Is this a good idea?©2005-2007 Carlos Guestrin29The problem with Base Case 3a b y0 0 00 1 11 0 11 1 0y = a XOR bThe information gains:The resulting decisiontree:©2005-2007 Carlos


View Full Document

CMU CS 10701 - decisiontrees

Documents in this Course
lecture

lecture

12 pages

lecture

lecture

17 pages

HMMs

HMMs

40 pages

lecture

lecture

15 pages

lecture

lecture

20 pages

Notes

Notes

10 pages

Notes

Notes

15 pages

Lecture

Lecture

22 pages

Lecture

Lecture

13 pages

Lecture

Lecture

24 pages

Lecture9

Lecture9

38 pages

lecture

lecture

26 pages

lecture

lecture

13 pages

Lecture

Lecture

5 pages

lecture

lecture

18 pages

lecture

lecture

22 pages

Boosting

Boosting

11 pages

lecture

lecture

16 pages

lecture

lecture

20 pages

Lecture

Lecture

20 pages

Lecture

Lecture

39 pages

Lecture

Lecture

14 pages

Lecture

Lecture

18 pages

Lecture

Lecture

13 pages

Exam

Exam

10 pages

Lecture

Lecture

27 pages

Lecture

Lecture

15 pages

Lecture

Lecture

24 pages

Lecture

Lecture

16 pages

Lecture

Lecture

23 pages

Lecture6

Lecture6

28 pages

Notes

Notes

34 pages

lecture

lecture

15 pages

Midterm

Midterm

11 pages

lecture

lecture

11 pages

lecture

lecture

23 pages

Boosting

Boosting

35 pages

Lecture

Lecture

49 pages

Lecture

Lecture

22 pages

Lecture

Lecture

16 pages

Lecture

Lecture

18 pages

Lecture

Lecture

35 pages

lecture

lecture

22 pages

lecture

lecture

24 pages

Midterm

Midterm

17 pages

exam

exam

15 pages

Lecture12

Lecture12

32 pages

lecture

lecture

19 pages

Lecture

Lecture

32 pages

boosting

boosting

11 pages

pca-mdps

pca-mdps

56 pages

bns

bns

45 pages

mdps

mdps

42 pages

svms

svms

10 pages

Notes

Notes

12 pages

lecture

lecture

42 pages

lecture

lecture

29 pages

lecture

lecture

15 pages

Lecture

Lecture

12 pages

Lecture

Lecture

24 pages

Lecture

Lecture

22 pages

Midterm

Midterm

5 pages

mdps-rl

mdps-rl

26 pages

Load more
Download decisiontrees
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view decisiontrees and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view decisiontrees 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?