Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear regression Q1 #11

Closed
Umartahir93 opened this issue Apr 16, 2018 · 1 comment
Closed

Linear regression Q1 #11

Umartahir93 opened this issue Apr 16, 2018 · 1 comment

Comments

@Umartahir93
Copy link

Umartahir93 commented Apr 16, 2018

def gradientDescent(X, y, theta, alpha, iters):
temp = np.matrix(np.zeros(theta.shape))
parameters = int(theta.ravel().shape[1])
cost = np.zeros(iters)

//why are we using below loop? Its a matrix multiplication I dont think we need to
//loop here. It will always give the same answer. Can you please tell me what is the benefit of using loop here?
for i in range(iters):
error = (X * theta.T) - y

@Umartahir93
Copy link
Author

Umartahir93 commented Apr 16, 2018

I understand now that is used for theta convergence oops my bad. It was easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant