Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please provide the solution to part c Derivative. Thanks. 2 Linear Regression We investigate the solution of regression. For simplicity, we have only one feature
Please provide the solution to part c Derivative. Thanks.
2 Linear Regression We investigate the solution of regression. For simplicity, we have only one feature to predict y. Suppose we are given samples (x,y),...,xn, yn). wo, Wi are parameters, and we are to find parameters that best fit the following relation: wo + 12 = yi. (a) Centering. (5 pts) Let @ = ID; Di and Di-f. are called centered since h = 0. Let i be the values predicted by Di, wo, w: i = wo + w12;. Show that can be predicted by x as well. That is, there are parameters wo, w such that i = wo + wc, and write wo, w in terms of wo, w1, and f, but notri r, I = Di- , therefore, Ti = + Answer: We know, i = wo + w12, and c = (1) put Xi = x + in the above equation i = to +101(c+1) Vi = 0 + 11 + 101 vi = 10+ f + W Vi = +wa wo = wo + wc Note: = w = w r; (mean of feature x) (b) Loss function. (5 pts) In (a), we converted linear regression on , with parameters wo, w to linear regression on x with wow. Write the loss functions of the both. Specifically, let's assume J is the loss function of the former, and I' is of the latter. is y = Wo + 12 Answer: Linear regression on I, with parameters to and w Loss function of the above can be calculated as: J = (1/2n) , - y) n = number of samples i = predicted values y = actual values J' = (1/2n) k-(wo + w124 - y)2 (c) Derivative. [5 pts] Take the derivative of J' with respect to wo, w, respectively. 2 Linear Regression We investigate the solution of regression. For simplicity, we have only one feature to predict y. Suppose we are given samples (x,y),...,xn, yn). wo, Wi are parameters, and we are to find parameters that best fit the following relation: wo + 12 = yi. (a) Centering. (5 pts) Let @ = ID; Di and Di-f. are called centered since h = 0. Let i be the values predicted by Di, wo, w: i = wo + w12;. Show that can be predicted by x as well. That is, there are parameters wo, w such that i = wo + wc, and write wo, w in terms of wo, w1, and f, but notri r, I = Di- , therefore, Ti = + Answer: We know, i = wo + w12, and c = (1) put Xi = x + in the above equation i = to +101(c+1) Vi = 0 + 11 + 101 vi = 10+ f + W Vi = +wa wo = wo + wc Note: = w = w r; (mean of feature x) (b) Loss function. (5 pts) In (a), we converted linear regression on , with parameters wo, w to linear regression on x with wow. Write the loss functions of the both. Specifically, let's assume J is the loss function of the former, and I' is of the latter. is y = Wo + 12 Answer: Linear regression on I, with parameters to and w Loss function of the above can be calculated as: J = (1/2n) , - y) n = number of samples i = predicted values y = actual values J' = (1/2n) k-(wo + w124 - y)2 (c) Derivative. [5 pts] Take the derivative of J' with respect to wo, w, respectivelyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started