Professional Documents
Culture Documents
Linear Models
Linear Models
Todays topics"
Learning from Examples: brief review!
Univariate Linear Regression!
Batch gradient descent!
Stochastic gradient descent!
Linear Classifiers!
Perceptron learning rule!
Logistic Regression!
Important issues"
Generalization !
Overfitting!
Cross-validation!
Holdout cross validation!
K-fold cross validation!
Leave-one-out cross-validation!
Model selection!
Recall Notation"
(x1, y1 ), (x 2 , y 2 ),K (x N , y N )
training set!
approximates
the true function! f
hypothesis!
10
Loss Functions"
Suppose the true prediction for input x is f (x) = y
but the hypothesis gives h(x) = y
12
weight vector!
hw (x) = w1 x + w 0
Find weight vector that minimizes empirical loss,
e.g., L2:!
Loss(hw ) = L2 (y j , hw (x j )) = (y j hw (x j )) 2 = (y j (w1 x j + w 0 )) 2
j =1
j =1
j =1
w* = argmin w Loss(hw )
13
Weight Space"
14
Finding w*"
Find weights such that:!
N
N
2
(y j (w1 x j + w 0 )) = 0 and
(y j (w1 x j + w 0 )) 2 = 0
w 0 j =1
w1 j =1
15
Gradient Descent"
wi wi
Loss(w)
w i
step size or!
learning rate!
16
Then:!
hsw (x j ) = w x j = wT x j = w i x j,i
w i w i + (y j hw (x j ))x j,i
j
18
y = Xw
1
w* = ( XT X) XT y
pseudo inverse!
19
Regularization"
Cost(h) = EmpLoss(h) + Complexity(h)
Complexity(hw ) = Lq (w) = w i
20
L1 vs. L2 Regularization"
21
22
Linearly separable: !
data is linearly separable if the classes can be
separated by a linear separator!
Classification hypothesis:!
hw (x) = Threshold(w x) where Threshold(z) = 1 if z 0 and 0 otherwise
23
If the output is correct, i.e., y =h w (x), then the weights don't change
If y = 1 but hw (x) = 0, then w i is increased when x i is positive and decreased when x i is negative.
If y = 0 but hw (x) = 1, then w i is decreased when x i is positive and increased when x i is negative.
Perceptron Performance"
25
An important function!!
26
Logistic Regression"
1
hw (x) = Logistic(w x) =
1+ e wx
27
separable case!
28
Summary"
Learning from Examples: brief review!
Loss functions!
Generalization!
Overfitting!
Cross-validation!
Regularization!
Linear Classifiers!
Perceptron learning rule!
Logistic Regression!
29
Next Class"
Artificial Neural Networks, Nonparametric
Models, & Support Vector Machines!
Secs. 18.7 18.9!
30