1 Machine Learning Lecture 8: Ensemble Methods Moshe Koppel Slides adapted from Raymond J. Mooney and others.

Slides:



Advertisements
Similar presentations
Ensemble Learning Reading: R. Schapire, A brief introduction to boosting.
Advertisements

My name is Dustin Boswell and I will be presenting: Ensemble Methods in Machine Learning by Thomas G. Dietterich Oregon State University, Corvallis, Oregon.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Other Classification Techniques 1.Nearest Neighbor Classifiers 2.Support Vector Machines.
Ensemble Methods An ensemble method constructs a set of base classifiers from the training data Ensemble or Classifier Combination Predict class label.
Data Mining Classification: Alternative Techniques
FilterBoost: Regression and Classification on Large Datasets Joseph K. Bradley 1 and Robert E. Schapire 2 1 Carnegie Mellon University 2 Princeton University.
Games of Prediction or Things get simpler as Yoav Freund Banter Inc.
Longin Jan Latecki Temple University
Paper presentation for CSI5388 PENGCHENG XI Mar. 23, 2005
Sparse vs. Ensemble Approaches to Supervised Learning
Ensemble Learning what is an ensemble? why use an ensemble?
A Brief Introduction to Adaboost
Ensemble Learning: An Introduction
Adaboost and its application
Three kinds of learning
Introduction to Boosting Aristotelis Tsirigos SCLT seminar - NYU Computer Science.
Machine Learning: Ensemble Methods
Sparse vs. Ensemble Approaches to Supervised Learning
CS 4700: Foundations of Artificial Intelligence
Boosting Main idea: train classifiers (e.g. decision trees) in a sequence. a new classifier should focus on those cases which were incorrectly classified.
For Better Accuracy Eick: Ensemble Learning
Ensembles of Classifiers Evgueni Smirnov
Machine Learning CS 165B Spring 2012
Issues with Data Mining
Zhangxi Lin ISQS Texas Tech University Note: Most slides are from Decision Tree Modeling by SAS Lecture Notes 6 Ensembles of Trees.
Machine Learning1 Machine Learning: Summary Greg Grudic CSCI-4830.
Modified from the slides by Dr. Raymond J. Mooney
CS 391L: Machine Learning: Ensembles
LOGO Ensemble Learning Lecturer: Dr. Bo Yuan
Benk Erika Kelemen Zsolt
Boosting of classifiers Ata Kaban. Motivation & beginnings Suppose we have a learning algorithm that is guaranteed with high probability to be slightly.
CS Fall 2015 (© Jude Shavlik), Lecture 7, Week 3
BOOSTING David Kauchak CS451 – Fall Admin Final project.
CS Machine Learning 21 Jan CS 391L: Machine Learning: Decision Tree Learning Raymond J. Mooney University of Texas at Austin.
Combining multiple learners Usman Roshan. Bagging Randomly sample training data Determine classifier C i on sampled data Goto step 1 and repeat m times.
Ensemble Methods: Bagging and Boosting
Ensembles. Ensemble Methods l Construct a set of classifiers from training data l Predict class label of previously unseen records by aggregating predictions.
Ensemble Learning Spring 2009 Ben-Gurion University of the Negev.
CS Ensembles1 Ensembles. 2 A “Holy Grail” of Machine Learning Automated Learner Just a Data Set or just an explanation of the problem Hypothesis.
CLASSIFICATION: Ensemble Methods
ISQS 6347, Data & Text Mining1 Ensemble Methods. ISQS 6347, Data & Text Mining 2 Ensemble Methods Construct a set of classifiers from the training data.
Tony Jebara, Columbia University Advanced Machine Learning & Perception Instructor: Tony Jebara.
E NSEMBLE L EARNING : A DA B OOST Jianping Fan Dept of Computer Science UNC-Charlotte.
Ensemble Methods in Machine Learning
Random Forests Ujjwol Subedi. Introduction What is Random Tree? ◦ Is a tree constructed randomly from a set of possible trees having K random features.
Classification Ensemble Methods 1
1 January 24, 2016Data Mining: Concepts and Techniques 1 Data Mining: Concepts and Techniques — Chapter 7 — Classification Ensemble Learning.
Classification and Prediction: Ensemble Methods Bamshad Mobasher DePaul University Bamshad Mobasher DePaul University.
Decision Trees IDHairHeightWeightLotionResult SarahBlondeAverageLightNoSunburn DanaBlondeTallAverageYesnone AlexBrownTallAverageYesNone AnnieBlondeShortAverageNoSunburn.
Machine Learning in Practice Lecture 24 Carolyn Penstein Rosé Language Technologies Institute/ Human-Computer Interaction Institute.
… Algo 1 Algo 2 Algo 3 Algo N Meta-Learning Algo.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Bagging and Boosting Cross-Validation ML.
Combining multiple learners Usman Roshan. Decision tree From Alpaydin, 2010.
1 Machine Learning: Ensemble Methods. 2 Learning Ensembles Learn multiple alternative definitions of a concept using different training data or different.
Ensemble Classifiers.
Machine Learning: Ensemble Methods
Data Mining Practical Machine Learning Tools and Techniques
Reading: R. Schapire, A brief introduction to boosting
Bagging and Random Forests
Machine Learning: Ensembles
Ensemble Learning Introduction to Machine Learning and Data Mining, Carla Brodley.
ECE 5424: Introduction to Machine Learning
A “Holy Grail” of Machine Learing
Combining Base Learners
Data Mining Practical Machine Learning Tools and Techniques
Introduction to Data Mining, 2nd Edition
Ensemble learning.
Model Combination.
Ensemble learning Reminder - Bagging of Trees Random Forest
CS 391L: Machine Learning: Ensembles
Presentation transcript:

1 Machine Learning Lecture 8: Ensemble Methods Moshe Koppel Slides adapted from Raymond J. Mooney and others

2 General Idea

3 Value of Ensembles When combing multiple independent and diverse decisions each of which is at least more accurate than random guessing, random errors cancel each other out, correct decisions are reinforced. Human ensembles are demonstrably better –How many jelly beans in the jar?: Individual estimates vs. group average. –Who Wants to be a Millionaire: Expert friend vs. audience vote.

4 Why does it work? Suppose there are 25 base classifiers –Each classifier has error rate,  = 0.35 –Assume classifiers are independent –Probability that the ensemble classifier makes a wrong prediction: This value approaches 0 as the number of classifiers increases. This is just the law of higher numbers but in this context is sometimes called “Condorcet’s Jury Theorem”.

5 Generating Multiple Models Use a single, arbitrary learning algorithm but manipulate training data to make it learn multiple models. –Data1  Data2  …  Data m –Learner1 = Learner2 = … = Learner m Different methods for changing training data: –Bagging: Resample training data –Boosting: Reweight training data –D ECORATE: Add additional artificial training data In W EKA, these are called meta-learners: they take a learning algorithm as an argument (base learner) Other approaches to generating multiple models: –vary some random parameter in learner, e.g., order of examples –vary choice of feature set: Random Forests

6 Bagging Create ensembles by repeatedly randomly resampling the training data (Brieman, 1996). Given a training set of size n, create m samples of size n by drawing n examples from the original data, with replacement. –Each bootstrap sample will on average contain 63.2% of the unique training examples, the rest are replicates. Combine the m resulting models using simple majority vote. Decreases error by decreasing the variance in the results due to unstable learners, algorithms (like decision trees) whose output can change dramatically when the training data is slightly changed.

7 Bagging Base learner = Single level binary tree (“stump”) True rule x.75 No stump perfect

8 Bagging Accuracy of ensemble classifier: 100%

9 Bagging- Final Points Works well if the base classifiers are unstable (i.e., pointless to try this with nearest neighbor) Increased accuracy because it reduces variance as compared to any individual classifier Multiple models can be learned in parallel

10 Boosting Originally developed by computational learning theorists to guarantee performance improvements on fitting training data for a weak learner that only needs to generate a hypothesis with a training accuracy greater than 0.5 (Schapire, 1990). Revised to be a practical algorithm, AdaBoost, for building ensembles that empirically improves generalization performance (Freund & Shapire, 1996). Examples are given weights. At each iteration, a new hypothesis is learned and the examples are reweighted to focus the system on examples that the most recently learned classifier got wrong.

11 Boosting: Basic Algorithm General Loop: Set all examples to have equal uniform weights. For t from 1 to T do: Learn a hypothesis, h t, from the weighted examples Decrease the weights of examples h t classifies correctly Base (weak) learner must focus on correctly classifying the most highly weighted examples while strongly avoiding over-fitting. During testing, each of the T hypotheses get a weighted vote proportional to their accuracy on the training data.

12 AdaBoost Pseudocode TrainAdaBoost(D, BaseLearn) For each example d i in D let its weight w i =1/|D| For t from 1 to T do: Learn a hypothesis, h t, from the weighted examples: h t =BaseLearn(D) Calculate the error, ε t, of the hypothesis h t as the total sum weight of the examples that it classifies incorrectly. If ε t > 0.5 then exit loop, else continue. Let β t = ε t / (1 – ε t ) Multiply the weights of the examples that h t classifies correctly by β t Rescale the weights of all of the examples so the total sum weight remains 1. Return H={h 1,…,h T } TestAdaBoost(ex, H) Let each hypothesis h t in H vote for ex’s classification with weight log(1/ β t ) Return the class with the highest weighted vote total.

13 AdaBoost Pseudocode TrainAdaBoost(D, BaseLearn) For each example d i in D let its weight w i =1/|D| For t from 1 to T do: Learn a hypothesis, h t, from the weighted examples: h t =BaseLearn(D) Calculate the error, ε t, of the hypothesis h t as the total sum weight of the examples that it classifies incorrectly. If ε t > 0.5 then exit loop, else continue. Let β t = ε t / (1 – ε t ) Multiply the weights of the examples that h t classifies correctly by β t Rescale the weights of all of the examples so the total sum weight remains 1. Return H={h 1,…,h T } TestAdaBoost(ex, H) Let each hypothesis h t in H vote for ex’s classification with weight log(1/ β t ) Return the class with the highest weighted vote total. Before reweighting the total weight of these is 1 – ε t, so now the total weight is ε t

14 AdaBoost Pseudocode TrainAdaBoost(D, BaseLearn) For each example d i in D let its weight w i =1/|D| For t from 1 to T do: Learn a hypothesis, h t, from the weighted examples: h t =BaseLearn(D) Calculate the error, ε t, of the hypothesis h t as the total sum weight of the examples that it classifies incorrectly. If ε t > 0.5 then exit loop, else continue. Let β t = ε t / (1 – ε t ) Multiply the weights of the examples that h t classifies correctly by β t Rescale the weights of all of the examples so the total sum weight remains 1. Return H={h 1,…,h T } TestAdaBoost(ex, H) Let each hypothesis h t in H vote for ex’s classification with weight log(1/ β t ) Return the class with the highest weighted vote total.

15 AdaBoost Pseudocode TrainAdaBoost(D, BaseLearn) For each example d i in D let its weight w i =1/|D| For t from 1 to T do: Learn a hypothesis, h t, from the weighted examples: h t =BaseLearn(D) Calculate the error, ε t, of the hypothesis h t as the total sum weight of the examples that it classifies incorrectly. If ε t > 0.5 then exit loop, else continue. Let β t = ε t / (1 – ε t ) Multiply the weights of the examples that h t classifies correctly by β t Rescale the weights of all of the examples so the total sum weight remains 1. Return H={h 1,…,h T } TestAdaBoost(ex, H) Let each hypothesis h t in H vote for ex’s classification with weight log(1/ β t ) Return the class with the highest weighted vote total. As ε t  ½, weight  0; as ε t  0, weight  

16 Learning with Weighted Examples Generic approach is to replicate examples in the training set proportional to their weights (e.g. 10 replicates of an example with a weight of 0.01 and 100 for one with weight 0.1). Most algorithms can be enhanced to efficiently incorporate weights directly in the learning algorithm so that the effect is the same (e.g. implement the WeightedInstancesHandler interface in W EKA ). For decision trees, for calculating information gain, when counting example i, simply increment the corresponding count by w i rather than by 1.

17 Toy Example

18 Final Classifier

19 Training Error

20 Experimental Results on Ensembles (Freund & Schapire, 1996; Quinlan, 1996) Ensembles have been used to improve generalization accuracy on a wide variety of problems. On average, Boosting provides a larger increase in accuracy than Bagging. Boosting on rare occasions can degrade accuracy. Bagging more consistently provides a modest improvement. Boosting is particularly subject to over-fitting when there is significant noise in the training data.

21 D ECORATE (Melville & Mooney, 2003) What if the training set is small, and therefore resampling and reweighting the training set has limited ability to generate diverse alternative hypotheses? Can generate multiple models by using all training data and adding fake training examples with made-up labels in order to force variation in learned models. Miraculously, this works.

22 Base Learner Overview of D ECORATE Training Examples Artificial Examples Current Ensemble C

23 C1 Base Learner Overview of D ECORATE Training Examples Artificial Examples Current Ensemble C

24 C1 C2Base Learner Overview of D ECORATE Training Examples Artificial Examples Current Ensemble C3

25 Another Approach: Random Forests Random forests (RF) are a combination of tree predictors Generate multiple trees by repeatedly choosing some random subset of all features Optionally also use random subset of examples as in bagging

26 Random Forests Algorithm Given a training set S For i = 1 to k do: Build subset S i by sampling with replacement from S Learn tree T i from S i At each node: Choose best split from random subset of F features Make predictions according to majority vote of the set of k trees.

27 Random Forests Like bagging, multiple models can be learned in parallel No need to get fancy; don’t bother pruning Designed for using decision trees as base learner, but can be generalized to other learning methods

28 Issues in Ensembles Can generate multiple classifiers by –Resampling training data –Reweighting training data –Varying learning parameters –Varying feature set Boosting can’t be run in parallel and is very sensitive to noise, but (in the absence of noise) seems very insensitive to overfitting Ability of ensemble methods to reduce variance depends on independence of learned classifiers