Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… ·...

35
Boosting Methods Benk Erika Kelemen Zsolt

Transcript of Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… ·...

Page 1: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting Methods

Benk ErikaKelemen Zsolt

Page 2: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Summary

OverviewBoosting – approach, definition, characteristicsEarly Boosting AlgorithmsAdaBoost – introduction, definition, main idea, the algorithmAdaBoost – analysis, training errorDiscrete AdaBoostAdaBoost – pros and contrasBoosting Example

Page 3: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Overview

Introduced in 1990soriginally designed for classification problemsextended to regressionmotivation - a procedure that combines the outputs of many “weak” classifiers to produce a powerful “committee”

Page 4: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

To add:

What is a classification problem, (slide)What is a weak learner, (slide)What is a committee, (slide)…… Later ……How it is extended to classification…

Page 5: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting Approachselect small subset of examplesderive rough rule of thumbexamine 2nd set of examplesderive 2nd rule of thumbrepeat T timesquestions:

how to choose subsets of examples to examine on each round?how to combine all the rules of thumb into single prediction rule?

boosting = general method of converting rough rules of thumb into highly accurate prediction rule

Page 6: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Ide egy kesobbi slide-ot… …… peldanak

Page 7: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - definition

A machine learning algorithmPerform supervised learningIncrements improvement of learned functionForces the weak learner to generate new hypotheses that make less mistakes on “harder” parts.

Page 8: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - characteristics

iterativesuccessive classifiers depends upon its predecessorslook at errors from previous classifier step to decide how to focus on next iteration over data

Page 9: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Early Boosting Algorithms

Schapire (1989):first provable boosting algorithmcall weak learner three times on three modified distributionsget slight boost in accuracyapply recursively

Page 10: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Early Boosting Algorithms

Freund (1990)“optimal” algorithm that “boosts by majority”

Drucker, Schapire & Simard (1992):first experiments using boostinglimited by practical drawbacks

Freund & Schapire (1995) – AdaBooststrong practical advantages over previous boosting algorithms

Page 11: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting

Training Sample

Weighted Sample

Weighted Sample

hT

h1

…h2 H

Page 12: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

BoostingTrain a set of weak hypotheses: h1, …., hT.

The combined hypothesis H is a weighted majority vote of the T weak hypotheses.

Each hypothesis ht has a weight αt.

During the training, focus on the examples that are misclassified.

At round t, example xi has the weight Dt(i).

))(()(1∑=

=T

ttt xhsignxH α

Page 13: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

BoostingBinary classification problem Training data:

Dt(i): the weight of xi at round t. D1(i)=1/m.A learner L that finds a weak hypothesis ht: X Y given the training set and DtThe error of a weak hypothesis ht:

}1,1{,),,(),....,,( 11 −=∈∈ YyXxwhereyxyx iimm

∑≠

=≠=iit

tyxhitiitDit iDyxh

)(:~ )(])([Prε

Page 14: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

AdaBoost - Introduction

Linear classifier with all its desirable propertiesHas good generalization propertiesIs a feature selector with a principled strategy (minimisation of upper bound on empirical error)Close to sequential decision making

Page 15: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

AdaBoost - Definition

Is an algorithm for constructing a “strong”classifier as linear combination

of simple “weak” classifiers ht(x).ht(x) - “weak” or basis classifier, hypothesis, ”feature”H(x) = sign(f(x)) – “strong” or final classifier/hypothesis

∑=

=T

ttt xhxf

1

)()( α

Page 16: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

The AdaBoost Algorithm

Input – a training set: S = {(x1, y1); … ;(xm, ym)}

xi ε X, X instance spaceyi ε Y, Y finite label space

in binary case Y = {-1,+1}

Each round, t=1,…,T, AdaBoost calls a given weak or base learning algorithm –accepts as input a sequence of training examples (S) and a set of weights over the training example (Dt(i) )

Page 17: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

The AdaBoost Algorithm

The weak learner computes a weak classifier (ht), : ht : X → R Once the weak classifier has been received, AdaBoost chooses a parameter (αtεR ) – intuitively measures the importance that it assigns to ht.

Page 18: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

The main idea of AdaBoost

to use the weak learner to form a highly accurate prediction rule by calling the weak learner repeatedly on different distributions over the training examples. initially, all weights are set equally, but each round the weights of incorrectly classified examples are increased so that those observations that the previously classifier poorly predicts receive greater weight on the next iteration.

Page 19: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

The AlgorithmGiven (x1, y1),…, (xm, ym) where xiєX, yiє{-1, +1}Initialise weights D1(i) = 1/mIterate t=1,…,T:

Train weak learner using distribution DtGet weak classifier: ht : X → R Choose αtεRUpdate:

where Zt is a normalization factor (chosen so that Dt+1 will be a distribution), and αt:

Output – the final classifier

t

itittt Z

xhyiDiD ))(exp()()(1α−

=+

T

))(()(1∑=

=t

tt xhsignxH α

01ln21

>⎟⎟⎠

⎞⎜⎜⎝

⎛ −=

t

tt ε

εα

Page 20: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

AdaBoost - Analysisthe weights Dt(i) are updated and normalised on each round. The normalisation factor takes the form

and it can be verified that Zt measures exactly the ratio of the new to the old value of the exponential sum

on each round, so that пtZt is the final value of this sum. We will see below that this product plays a fundamental role in the analysis of AdaBoost.

Page 21: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

AdaBoost – Training Error

Theorem:run Adaboostlet εt=1/2-γt

then the training error:

∏ ∏ ∑−≤−=−≤t t t

ttttfinalH )2exp(41)1(2 22 γγεε

Tfinalt eHt

220: γγγ −≤⇒>≥∀

Page 22: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Choosing parameters for Discrete AdaBoost

In Freund and Schapire’s original Discrete AdaBoost the algorithm each round selects the weak classifier, ht, that minimizes the weighted error on the training set

Minimizing Zt, we can rewrite:

Page 23: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Choosing parameters for Discrete AdaBoost

analytically we can choose αt by minimizing the first (εt=…) expression:

Plugging this into the second equation (Zt), we can obtain:

Page 24: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Discrete AdaBoost - AlgorithmGiven (x1, y1),…, (xm, ym) where xiєX, yiє{-1, +1}Initialise weights D1(i) = 1/mIterate t=1,…,T:

Find where Set

Update:

Output – the final classifier

t

itittt Z

xhyiDiD ))(exp()()(1α−

=+

))(()(1∑=

=T

ttt xhsignxH α

Page 25: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

AdaBoost – Pros and Contras

Pros:Very simple to implementFairly good generalizationThe prior error need not be known ahead of time

Contras:Suboptimal solutionCan over fit in presence of noise

Page 26: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 27: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 28: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 29: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - ExampleEzt kellene korabban is mutatni …… peldanak

Page 30: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 31: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 32: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 33: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Boosting - Example

Page 34: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Bibliography

Friedman, Hastie & Tibshirani: The Elements of Statistical Learning (Ch. 10), 2001Y. Freund: Boosting a weak learning algorithm by majority. In Proceedings of the Workshop on Computational Learning Theory, 1990.Y. Freund and R.E. Schapire: A decision-theoretic generalization of on-line learning and an application to boosting. In Proceedings of the Second European Conference on Computational Learning Theory, 1995.

Page 35: Boosting Methods - Babeș-Bolyai Universitycsatol/mach_learn/bemutato/BenkKelemen_Boosti… · Boosting Methods Benk Erika Kelemen Zsolt. Summary Overview Boosting – approach, definition,

Bibliography

J. Friedman, T. Hastie, and R. Tibshirani: Additive logistic regression: a statistical view of boosting. Technical Report, Dept. of Statistics, Stanford University, 1998.Thomas G. Dietterich: An experimental comparison of three methods for constructing ensembles of decision trees: Bagging, boosting, and randomization. Machine Learning, 139–158, 2000.