lecture 5 classification and dimension reduction
play

Lecture 5: Classification and dimension reduction Felix Held, - PowerPoint PPT Presentation

Lecture 5: Classification and dimension reduction Felix Held, Mathematical Sciences MSA220/MVE440 Statistical Learning for Big Data 4th April 2019 Random Forests 1. Given a training sample with features, do for = 1, , on


  1. Lecture 5: Classification and dimension reduction Felix Held, Mathematical Sciences MSA220/MVE440 Statistical Learning for Big Data 4th April 2019

  2. Random Forests 1. Given a training sample with ๐‘ž features, do for ๐‘ = 1, โ€ฆ , ๐ถ on bootstrapped data. Note: Step 1.2.1 leads to less correlation between trees built Majority vote at ๐ฒ across trees Classification: ๐ถ 1 ๐‘ ๐‘ (๐ฒ) = ๐‘” ห† Regression: 2. For a new ๐ฒ predict 1.2.3 Split the node 1.2.2 Find best splitting variable among these ๐‘› 1.2.1 Randomly select ๐‘› variables from the ๐‘ž available ๐‘œ min replacement) 1.1 Draw a bootstrap sample of size ๐‘œ from training data (with 1/21 1.2 Grow a tree ๐‘ˆ ๐‘ until each node reaches minimal node size ๐ถ โˆ‘ ๐‘=1 ๐‘ˆ ๐‘ (๐ฒ)

  3. Comparison of RF, Bagging and CART ๐ฒ โˆผ ๐‘‚(๐Ÿ, ๐šป), ๐ฒ โˆˆ โ„ 5 , Toy example Training and test data were sampled from the true model. Results 2/21 ๐œ โˆผ ๐‘‚(0, 1) ๐‘ง = ๐‘ฆ 2 where 1 + ๐œ ๐šป ๐‘š๐‘š = 1, ๐šป ๐‘š๐‘™ = 0.98, ๐‘š โ‰  ๐‘™ for RF, bagged CART and a single CART, using ๐‘ฆ 1 , โ€ฆ , ๐‘ฆ 5 as predictor variables. ( ๐‘œ ๐‘ข๐‘  = 50 , ๐‘œ ๐‘ข๐‘“ = 100 ) โ— Test error 2.1 โ— โ— 1.8 โ— โ— โ— โ— โ— โ— โ— โ— โ— 1.5 โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— 0 100 200 300 Number of trees

  4. Variable importance set for that particular tree, since they were not used serves as an importance measure for variable ๐‘˜ 1 ๐น (๐‘˜) 1 calculate test error again ๐น (๐‘˜) 1. Impurity index: Splitting on a feature leads to a reduction during training. Resulting in test error ๐น 0 a chance of about 63% to be selected trees per feature gives a measure for variable importance of node impurity. Summing all improvements over all 3/21 2. Out-of-bag error โ–ถ During bootstrapping for large enough ๐‘œ , each sample has โ–ถ For bagging the remaining samples are out-of-bag . โ–ถ These out-of-bag samples for tree ๐‘ˆ ๐‘ can be used as a test โ–ถ Permute variable ๐‘˜ in the out-of-bag samples and โ–ถ The increase in error โˆ’ ๐น 0 โ‰ฅ 0

  5. RF applied to cardiovascular dataset Monica dataset ( http://thl.fi/monica , ๐‘œ = 6367 , ๐‘ž = 11 ) 4/21 number of cardiovascular risk factors (class ratio 1.25 alive : 1 dead) Predicting whether or not patients survive a 10 year period given a Error estimate Variable importance 0.25 โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— yronset โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— stroke Type โ— โ— Type Alive Acc. smstat Alive 0.20 โ— Dead Acc. Dead โ— Outโˆ’ofโˆ’bag error Mean Acc. sex โ— OOB Mean Gini โ— โ— premi โ— โ— โ— 0.15 โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— hosp โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— highbp โ— 0.10 โ— hichol โ— โ— โ— โ— โ— diabetes โ— โ— โ— โ— โ— โ— โ— 0.05 โ— angina โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— age โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— โ— 0 50 100 150 200 0 1 2 3 Number of Trees Decrease

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend