Docsity

Minimizing Future Error: Model Selection and Kernel Density Estimation - Prof. Alexander G, Study notes of Computer Science

Partial preview of the text

Download Minimizing Future Error: Model Selection and Kernel Density Estimation - Prof. Alexander G and more Study notes Computer Science in PDF only on Docsity!

CSE 6740 Lecture 5

How Do I Learn

Any

Density?

(Model Selection and Nonparametric Estimation)

Alexander Gray [email protected] Georgia Institute of Technology CSE 6740 Lecture 5 – p.1/

Today

1. Model selection and generalization

(How do we

minimize

future

error? Two Gaussians or three?)

2. Nonparametric estimation

(What if I don’t want to

specify a simple parametric form?)

3. Kernel density estimation

(How can I estimate a density

nonparametrically?)

CSE 6740 Lecture 5 – p.2/

Model (Class) Selection

How many components

K

should we use? We could say

that our model class is the set of all possible mixtures with aparameter

K

thrown in. However, this is no longer a finite

number of parameters; we’ll consider this scenario(

nonparametric estimation

) separately.

So we usually consider

parameter selection

(e.g. choosing

μ,

) separately from

model selection

(e.g. choosing

K

or choosing between two different kinds of distributions).

The extent to which these two processes should be differentor the same is subtle and we will talk about this more.

CSE 6740 Lecture 5 – p.4/

Training and Testing

Recall the meaning of

training

and

testing

CSE 6740 Lecture 5 – p.5/

Training and Test Error

Our goal: find the model

M

which minimizes the test error:

inf M

R
M

. This is called

model selection

CSE 6740 Lecture 5 – p.7/

Training and Test Error

We call choosing a suboptimal model

overfitting

or

underfitting

CSE 6740 Lecture 5 – p.8/

Training and Test Error

The training error is a downward-biased estimate of theprediction risk:

R

tr

M
< R
M

CSE 6740 Lecture 5 – p.10/

Model Selection and Assessment

To perform model selection, we just need to know the relative values

of the test error for different models.

Asymptotic approximations can sometimes be useful forcomparing the test error for different models.These are generally not good estimators of the

actual values

of the errors. Asymptotic arguments are generally not goodenough to give us good finite-sample estimates, exceptpossibly for

very simple

models, such as linear regression.

For this we will turn to resampling methods.Of course if we have a good way direct estimator of the testerror, we can use it for model selection. We should whenwe can.

CSE 6740 Lecture 5 – p.11/

Optimism of the Training Error

In general we have

R
M
E
̂ R

tr

M

op

M

(7) ≈

lack of fit + complexity penalty

(8)

Thus to select the model we can:

1. obtain an estimate

op

M

, or

2. directly estimate

R
M

some other way.

CSE 6740 Lecture 5 – p.13/

Asymptotic Approach

First, let’s try to estimate the optimism asymptotically.Under squared-error loss, with the error model

Y

f

X

ǫ

where the error

ǫ

has zero mean and variance

σ 2

op

M
2 N

∑^ i

Cov

̂ Y

i

, Y

i

M
N

σ 2 (9)

where

M

is the number of parameters of the model.

CSE 6740 Lecture 5 – p.14/

AIC Statistic

Suppose we are using the log-likelihood for our loss:

l

M

) = log

L
M

) = log

N ∏^ i = f

X

i

M

N ∑^ i = log f

X

i

M

(11)

(Actually we use

l

M

If

M
{F

̂ θ

, it turns out that as

N
E

log f

X
M
E

̂^ l

tr

M

bθ

M
N

(12)

where

θ

is the MLE for

F

and

l

tr

M

bθ

is the likelihood on the

training data.

CSE 6740 Lecture 5 – p.16/

AIC Statistic

This leads to an estimate of

R
M

called

Akaike’s

Information Criterion

(AIC):

AIC

M
R

tr

M

bθ

M
N

σ 2 (13)

where

σ 2

is obtained from the MSE of a low-bias (complex)

model.This is the same as Mallows’

C

p

statistic except that it holds

under broader assumptions (it is a generalization). Notehowever that this does not hold in general, for example, for0-1 loss.Note that AIC is not consistent, i.e. does not choose theright model asymptotically.

CSE 6740 Lecture 5 – p.17/

Cross-Validation

V

-fold cross-validation

splits the data into

V

roughly

equal-sized chunks, using each chunk in turn as thevalidation set while taking the remainder as the training set.Denote by

f − v M

x

the estimate using the model

M

trained

on the data with the

v th

part removed. Then the

cross-validation

estimate of the test error

is

CV

M
1 N

V ∑^ v = N v ∑^ i =

L

y i

f − v M

x i

(14) CSE 6740 Lecture 5 – p.19/

Cross-Validation

V

-fold cross-validation requires running

V

training

optimizations.

CSE 6740 Lecture 5 – p.20/