Docsity

Understanding SVM & Ensemble Learning: Linear & Non-linear SVM, Kernel Functions, Bagging, Study notes of Computer Science

Partial preview of the text

Download Understanding SVM & Ensemble Learning: Linear & Non-linear SVM, Kernel Functions, Bagging and more Study notes Computer Science in PDF only on Docsity!

Lecture 12Lecture

Oct

th

ReviewReview

-^

Linear

SVM

seeks

to

find

a

linear

decision

boundary

that

i^

i^

th

t i

i

maximizes

th

e^

geometric

margin

-^

Using

the

concept

of

soft

margin,

we

can

achieve

tradeoff

between

maximizing

the

margin

and

faithfully

fitting

all

g^

g^

y^

g

training

examples,

thus

provides

better

handling

of

outliers/noisy

training

examples

and

(simple)

cases

that

are

not linearly separablenot

linearly

separable

-^

By

mapping

the

data

from

the

original

input

space

into

a

higher

dimensional

feature

space,

we

obtain

non

‐linear

SVM

–^

Let’s

see

a

bit

more

about

this

ξ c

N i

i

b min

1

2

,

+^

∑=

w w

Soft

margin

SVM

optimization

N

i

N

i ξ

b

y

i

i

i

i

subject to

L

L

x w

N

optimization problem^ •

Knowing

that

,^ we

can

rewrite

the

optimization

problem

in

terms

of

inner

products

∑=

N i

i i yi 1

x

w

N

i ξ

b

ξ c

y y N^

i j j

i

N i

i

ji

j i j i j i b

1

1 )

(

bj

min

1

, ,

≥ +>

⋅ <

∑

∑

∑

=

α α^

x x

w

I^

f^

l^

i^

f^

SVM i

i^

ll^

i d

i^

l^

h

N

i

N i ξ b y y

i

i

j

i j j j

i

, , 1

, 0

, , 1

, 1 )

( :

subject to

1

L

L

=

≥

= − ≥ + > ⋅ <

∑=

α^ ξ

x x

-^

In

fact,

learning

for

SVM

is

typically

carried

out

using

only

the

inner

products

of

x

,^ without

using

original

vector

of

x

-^

Now we just need to replace the inner products with anNow

we

just

need

to

replace

the

inner

products

with

an

appropriate

kernel

functions

What we have seen so farWhat

we

have

seen

so

far

•^

Linear SVMLinear

SVM

Geometric

margin

vs.

functional

margin

Problem formulation

Problem

formulation

•^

Soft

margin

SVM

Include

the

slack

variable

in

optimization

c

controls

the

trade

‐off

•^

Nonlinear

SVM

using

kernel

functions

Kernel

functions

Model selection for SVMModel

selection

for

SVM

•^

There are a number of model selectionThere

are

a

number

of

model

selection

questions

when

applying

SVM

Which kernel functions to use?

Which

kernel

functions

to

use?

What

c

parameter

to

use

(soft

margin)?

Y

h

t^

d f

lt

ti

•^

You

can

choose

t

o

use

d

efault

options

provided

by

the

software,

but

a

more

reliable

h i

t^

lid ti

approach

i

s^

to

use

cross

‐validations

Strength

vs weakness

-^

Strengths^ –

The

solution

is

globally

optimal

–^

It^

scales

well

with

high

dimensional

data

–^

It^

can

handle

non

‐traditional

data

like

strings,

trees,

instead

of

the

traditional

fixed

length

feature

vectors

-^

Why?

Because

as

long

as

we

can

define

a^

kernel

function

for

such

input,

we

can

apply

svm

-^

WeaknessWeakness^ –

Need

to

specify

a

good

kernel

–^

Training

time

can

be

long

if

you

use

the

wrong

software

package

2007

2006

1998

Ensemble LearningEnsemble

Learning

-^

So

far

we

have

designed

learning

algorithms

that

take

a

g^

g^

g

training

set

and

output

a

classifier

-^

What

if

we

want

more

accuracy

than

current

algorithms

ff

d?

afford?^ –

Develop

new

learning

algorithm

–^

Improve

existing

algorithms

-^

Another

approach

is

to

leverage

the

algorithms

we

have

via

ensemble

methods

I^

t^

d^

f^

lli

l^

ith

j^

t^

d^

i^

it^

l^

ifi

–^

Instead

of

calling

an

algorithm

just

once

and

using

it

s^ classifier

–^

Call

algorithm

multiple

times

and

combine

the

multiple

classifiers

What is Ensemble LearningWhat

is

Ensemble

Learning

Ensemble

method:

Traditional:

S

different

training

S

L

L

LS

h^

h

sets

and/or learning algorithms

L1 h

L

h^2

L

hS

h^1

h^1

(x,

  • h =^ F(h

,^1

h^2

,^ L

,^ h

)^ S^

(x,

(x,

  • y =h

(x)) 1

(x,

  • y =h

*^ (x))

How to generate ensemble?How

to

generate

ensemble?

•^

There are a variety of methods developedThere

are

a

variety

of

methods

developed

•^

We

will

look

at

two

of

them:

B

i

Bagging

Boosting

(Adaboost:

adaptive

boosting)

•^

Both

of

these

methods

takes

a

single

learning

algorithm

(we

will

call

this

the

base

learner

and

use

it

multiple

times

to

generate

multiple

classifiers

Bagging:

Bootstrap

Aggregation

(Breiman,

-^

Generate

a

random

sample

from

training

set

S

by

a

random

re

‐sampling

technique

called

bootstrapping

-^

Repeat

this

sampling

procedure,

getting

a

sequence

of

T

training

sets: S

S^

S

training

sets:

S

, 1 S^2

,…,

S T

-^

Learn

a

sequence

of

classifiers

h

,h

,…,h 2

forT

each

of

these

training

sets,

using

the

same

base

learner

-^

To

classify

an

unknown

point

X,

let

each

classifier

predict

-^

h^1

(X)

=^

1 h

(X) 2

=^

1,

h

(X) 3

=^

0,

…,

h

(X)T

=^

1,

-^

Take

simple

majority vote

to make the final

prediction

-^

Take

simple

majority

vote

to

make

the

final

prediction

–^

Predict

the

class

that

gets

the

most

vote

from

all

the

learned

classifers

The

true

decision

boundary

Decision

Boundary

by

h

CART D

i i

T

Al

i h

the

CART

D

ecision

T

ree

Al

gorithm

Note

that

the

decision

tree

has

trouble

representing

this

decision

boundary

Empirical

Results

for

Bagging

Decision

Trees

(^

)

(Freund

&

Schapire)

Each

point

represents

the

results

of

one

data

set

Why

can

bagging

improve

the

classification

accuracy?

The Concept of Bias and VarianceThe

Concept

of

Bias

and

Variance

Target

Bias

Variance