






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























TTIC 31020: Introduction to Machine Learning
Instructor: Greg Shakhnarovich
TTI–Chicago
October 11, 2010
Decomposition of expected squared error, for a fixed x 0 :
(y 0 − fˆ (x 0 ))^2
= (y 0 − F (x 0 ))^2 ︸ ︷︷ ︸ noise
( fˆ (x 0 ) − f¯ (x 0 ))^2
variance
see derivation notes posted on the website
Regularization
Sparsity
Previously: define model complexity as a number of parameters
This is a bit too simplistic. Consider feature vector obtained from x:
˜x =
1 x − 2 x 2 x x^2 12 x^2
Nominally, linear regression has 6 parameters. But they are clearly not independent.
Generally, we would like to automatically penalize the complexity of the model, in a more sophisticated way.
Idea: look at the behavior of the values of w∗
Intuition: should penalize not the parameters, but the number of bits required to encode the parameters
With finite set of parameter values, these are equivalent
With “infinite” set, we can limit the effective number of degrees of freedom by restricting the value of the parameters.
Then we have penalized log-likelihood:
w∗^ = argmax w
i=
log p(xi; w) − penalty(w)
Shrinkage methods impose penalty on the size of w
We can measure “size” in a few different ways. Let us start with L 2 norm:
w∗ ridge = argmax w
i=
log p(xi; w) − λ‖w‖^2
This is ridge regression; λ is the regularization parameter.
Note: no averaging of the log-likelihood!
w∗ ridge = argmin w
i=
yi − w 0 −
∑^ m
j=
wj x( ji)
2
∑^ m
j=
w^2 j
Usually do not include w 0 in regularization (why?) Closed form solution:
ŵ ridge∗ =
λI + XT^ X
XT^ y.
Careful: solution not invariant to scaling! Should normalize input before solving.
The L 1 -penalized log-likelihood under Gaussian noise model:
i=
(yi − wT^ xi)^2 − λ
∑^ m
j=
|wj |
This is still concave (i.e. unique maximum), but unfortunately neither closed-form solution nor gradient descent will do the trick.
Why is it called “lasso”?
Similarly, for Lasso:
min w
i=
yi − w 0 −
∑^ m
j=
wj x( ji)
2
subject to
∑^ m
j=
|wj | ≤ t
Compare shape of the penalty as a function of wj :
wj
(wj )^2
wj
|wj |
An equivalent formulation for Lp regularization: constrained maximization
wˆ = argmax w: Pmj=1 |wj |p≤β
i=
(yi − wT^ xi)^2.
w 2
w 1
`
w ˆM L
An equivalent formulation for Lp regularization: constrained maximization
wˆ = argmax w: Pmj=1 |wj |p≤β
i=
(yi − wT^ xi)^2.
w 2
w 1
`
w ˆM L
w^21 + w^22
w ˆridge
An equivalent formulation for Lp regularization: constrained maximization
wˆ = argmax w: Pmj=1 |wj |p≤β
i=
(yi − wT^ xi)^2.
w 2
w 1
`
w ˆM L
w^21 + w^22
w ˆridge
|w 1 | + |w 2 |
An equivalent formulation for Lp regularization: constrained maximization
wˆ = argmax w: Pmj=1 |wj |p≤β
i=
(yi − wT^ xi)^2.
w 2
w 1
`
w ˆM L
w^21 + w^22
w ˆridge
|w 1 | + |w 2 |
w ˆlasso (^) With sufficiently large λ, lasso leads to sparsity. Must explicitly solve the above optimization problem – e.g., using Lagrange multipliers.
An equivalent formulation for Lp regularization: constrained maximization
wˆ = argmax w: Pmj=1 |wj |p≤β
i=
(yi − wT^ xi)^2.
w 2
w 1
`
w ˆM L
w^21 + w^22
w ˆridge
|w 1 | + |w 2 |
w ˆlasso (^) With sufficiently large λ, lasso leads to sparsity. Must explicitly solve the above optimization problem – e.g., using Lagrange multipliers.