Docsity

Boosting - Introduction to Machine Learning | CSI 5325, Study notes of Computer Science

Partial preview of the text

Download Boosting - Introduction to Machine Learning | CSI 5325 and more Study notes Computer Science in PDF only on Docsity!

Intro. to machine learning (CSI 5325)

Lecture 27: Boosting

Greg Hamerly

Spring 2008

Outline

1 Ensemble methods

2 Boosting fundamentals

3 AdaBoost

4 AdaBoost analysis

Ensemble methods

Combining classifiers

Suppose that we have: n labeled examples (xi , yi ), where yi ∈ {− 1 , +1} a number of T hypotheses h 1 , h 2 ,... , hT , each trained on the data How should we combine the T classifiers? choose ht with the least training error

h(x) = hm(x) where m = argmax t

∑n i=

yi ht (xi )

choose ht with the least validation error use all T classifiers in a sum

h(x) = sign

( ∑T

t=

ht (x)

Ensemble methods

Combining classifiers (with weights)

Suppose that we have: n labeled examples (xi , yi ), where yi ∈ {− 1 , +1} a number of T hypotheses h 1 , h 2 ,... , hT , each trained on the data a weight αt for each hypothesis ht , which indicates its relative quality

Then we could form:

h(x) = sign

( ∑T

t=

αt ht (x)

This is the AdaBoost classifier.

Boosting fundamentals

What is a weak learner?

A weak learner is one which is expected to get < 50% error rate (test rate) on any binary learning task. 50% is usually an upper limit – why? if the hypothesis is wrong more than this, just reverse its decisions

This is an expectation of error over random datasets. Certainly on some datasets a learner may have poor generalization, due to misleading training data.

Boosting fundamentals

Start with a class of hypotheses

Choose a learner which can produce a weak hypothesis: decision trees – which are not very weak decision stumps – one-node decision trees hyperplane classifiers Domain knowledge can help here.

AdaBoost

AdaBoost algorithm (Freund & Schapire)

Initialize D 1 (i) = 1/n For t = 1,... , T : train weak learner using distribution Dt to get hypothesis ht ht : X → {− 1 , +1} has error εt = Pri∼Dt [ht (xi ) 6 = yi ] let αt = 12 log

( (^1) −ε εtt

update the distribution: Dt+1(i) = D Zt^ (i) t

×

{ (^) e−αt (^) if h t (xi ) =^ yi eαt^ if ht (xi ) 6 = yi where Zt is a normalizing term so Dt+1 is a distribution.

Classifier: H(x) = sign

( ∑T

t=

αt ht (x)

AdaBoost

Error of a weak hypothesis

The error of hypothesis ht is with respect to the distribution Dt : εt = Pri∼Dt [ht (xi ) 6 = yi ]

Compute as: εt =

∑^ n i=

Dt (i)I (ht (xi ) 6 = yi )

If Dt (i) = 0, then we don’t care about how ht classifies it.

Each ht should minimize the weighted error εt , which as opposed to the assumption that all errors are equally bad.

AdaBoost

Behavior of the weights

If an example is misclassified, its weight increases. Otherwise its weight decreases.

Dt+1(i) = D Zt^ (i) t

×

{ (^) e−αt (^) if h t (xi ) =^ yi eαt^ if ht (xi ) 6 = yi

If an example is always misclassified, then it becomes much more important, since the weights are retained over time.

AdaBoost

How much can the weights change?

Dt+1(i) = D Zt^ (i) t

×

{ (^) e−αt (^) if h t (xi ) =^ yi eαt^ if ht (xi ) 6 = yi recall: 0 ≤ εt ≤ 1 αt = 12 log

( (^1) −ε εtt

eαt^ =

(1 − εt )/εt e−αt^ =

εt /(1 − εt )

Thus, if εt ≈ 0, then Dt (i) → 0

AdaBoost

Role of αt

Recall the final classifier’s form:

H(x) = sign

( ∑T

t=

αt ht (x)

Also, αt =^12 log

( (^1) − ε t εt

Thus: εt = 0. 5 → αt = 0 εt < 0. 5 → αt > 0 εt > 0. 5 → αt < 0

AdaBoost

Relationship of αt and εt

αt =^12 log

( (^1) − ε t εt

-1.

-0.

0

1

2

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.

alpha

epsilon 17 / 25

AdaBoost

How does boosting help?

focuses effort on hard-to-classify examples takes hard work off the learner learners only have to specialize in small areas reduces classifier bias simple hypothesis usually has high bias ensemble can make more complicated decisions and lower bias reduces classifier variance (perhaps) can identify outliers

AdaBoost

Boosting works well when...

the margin between the two classes is large (as in SVMs) the data is fairly noise-free it’s easy to discover simple rules the weak learner can take a distribution over examples