Homework 4

1 Page
Unlock Document

Computer Science
Daniel Kifer

CMPSC 448: Machine Learning and AI: HW 4 (Due March 25) Name: 1. Instructions ▯ Upload to ANGEL one zipped ▯le (to avoid an ANGEL bug) containing: { Your version of hw4stub.py ▯ You cannot look at anyone else’s code. ▯ All code in hw4stub.py should be inside functions (importing hw3stub.py should not cause code to execute). ▯ To check your code, type \python hw4tester.py" at a command prompt. Your code will be graded based on correctness on di▯erent inputs (using Python version 2.x). 2. Gradient Descent In the following questions, we use the following notation. ~ = (w ;1 ;:2:;w ) ks the weight vector with dimension k. The data is f(x 1t1);:::;(xn;tn)g and has n records. Each ~xjis a feature vector whose components are represented as x j (x ;j1;:j2;x ). jk Pk We will be using the linear regression model whose prediction for a feature vecxjis ~ ▯xj= w i ji i=1 Question 1. If t js the target and w~ ▯xjis the prediction, we can measure the discrepancy using one-half 1 2 squared error: f(j ;~ ▯xj) = 2(tj▯ w~ ▯xj) . The average error over the training set is then: ! 2 Xn Xn Xk Xn 1 2 1 1 2 2n (j ▯ ~ ▯xj) = 2n tj▯ wixji = 2n (j ▯ w1x j1▯ w 2 j2▯ ▯▯▯ ▯ wkx jk j=1
More Less

Related notes for CMPSC 448

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.