Skip to content

Instantly share code, notes, and snippets.

@jainanchit51
Created May 6, 2018 09:30
Show Gist options
  • Save jainanchit51/a2b89f3d3f2f36663e6dfa4177e6b0ed to your computer and use it in GitHub Desktop.
Save jainanchit51/a2b89f3d3f2f36663e6dfa4177e6b0ed to your computer and use it in GitHub Desktop.
def _gradient_descent(self,X, y, theta, alpha, iterations):
for i in (iterations):
theta = theta - (alpha/len(X)) * np.sum((X @ theta.T - y) * X, axis=0)
cost = self.cost_calculation(X, y, theta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment