Question: Hi, For this problem from Stanford's CS229 (https://www.coursehero.com/u/file/40878200/ps1pdf/#question) I would really appreciate help with PSet 1 (2018) question (d) in exercise 3 (about poisson regression),

Hi,

For this problem from Stanford's CS229 (https://www.coursehero.com/u/file/40878200/ps1pdf/#question) I would really appreciate help with PSet 1 (2018) question (d) in exercise 3 (about poisson regression), which is a coding question to implement the poisson regression class :) I am not able to get a good prediction in this algo (only 13% accuracy).

Could you please help debug the code? (Below is what I use for the gradient descent)

for j in range(len(self.theta)):

self.theta[j] += self.step_size * np.mean(np.dot((y - np.exp(np.dot(x, self.theta))),x[:,j]))

Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!