Anda di halaman 1dari 17

Lecture Slides for

INTRODUCTION
TO
MACHNE
LEARNNG
3RD EDTON
ETHEM ALPAYDIN
The MIT Press, 2014

alpaydin@boun.edu.tr
http://www.cmpe.boun.edu.tr/~ethem/i2ml3e
CHAPTER 2:

SUPERVSED LEARNNG
Learning a Class from Examples
3

Class C of a family car


Prediction: Is car x a family car?
Knowledge extraction: What do people expect from a
family car?
Output:
Positive (+) and negative () examples
Input representation:
x1: price, x2 : engine power
Training set X

X {xt ,r t }tN1

1 if x is positive
r
0 if x is negative

x1
x
x2

4
Class C
5

p1 price p2 AND e1 engine power e2


Hypothesis class H
6

1 if h says x is positive
h( x)
0 if h says x is negative

Error of h on H

E (h | X ) 1hxt r t
N

t 1
S, G, and the Version Space
7

most specific hypothesis, S


most general hypothesis, G

h H, between S and G is
consistent and make up the
version space
(Mitchell, 1997)
Margin
8

Choose h with largest margin


VC Dimension
9

N points can be labeled in 2N ways as +/


H shatters N if there
exists h H consistent
for any of these:
VC(H ) = N

An axis-aligned rectangle shatters 4 points only !


Probably Approximately Correct (PAC)
10
Learning
How many training examples N should we have, such that with probability
at least 1 , h has error at most ?
(Blumer et al., 1989)

Each strip is at most /4


Pr that we miss a strip 1 /4
Pr that N instances miss a strip (1 /4)N
Pr that N instances miss 4 strips 4(1 /4)N
4(1 /4)N and (1 x)exp( x)
4exp( N/4) and N (4/)log(4/)
Noise and Model Complexity
11

Use the simpler one because


Simpler to use
(lower computational
complexity)
Easier to train (lower
space complexity)
Easier to explain
(more interpretable)
Generalizes better (lower
variance - Occams razor)
Multiple Classes, Ci i=1,...,K
X {xt ,r t }tN1
1 if x t
C i
ri
t

0 if x t
C j , j i

Train hypotheses
hi(x), i =1,...,K:

if t
Ci
hi x
t
1 x
0 if x t
C j , j i

12
Regression

X x , r
t

t N
t 1
gx w1x w0
rt gx w 2 x 2 w1 x w0

r t f x t

1 N t
N t 1

E g | X r g x
t 2

1 N t
N t 1

E w1 , w0 | X r w1 x w 0
t 2

13
Model Selection & Generalization
14

Learning is an ill-posed problem; data is not


sufficient to find a unique solution
The need for inductive bias, assumptions about H
Generalization: How well a model performs on new
data
Overfitting: H more complex than C or f
Underfitting: H less complex than C or f
Triple Trade-Off
15

There is a trade-off between three factors


(Dietterich, 2003):
1. Complexity of H, c (H),
2. Training set size, N,
3. Generalization error, E, on new data
As N,E
As c (H),first Eand then E
Cross-Validation
16

To estimate generalization error, we need data


unseen during training. We split the data as
Training set (50%)
Validation set (25%)

Test (publication) set (25%)

Resampling when there is few data


Dimensions of a Supervised Learner

1. Model: g x |

2. Loss function: E | X Lr t , gxt |


t

3. Optimization procedure:
* arg min E | X

17

Anda mungkin juga menyukai