Skip to content

Commit 04ecea6

Browse files
committed
Fix the issue trekhleb#9.
1 parent d16d88e commit 04ecea6

File tree

4 files changed

+1161
-1161
lines changed

4 files changed

+1161
-1161
lines changed

homemade/linear_regression/linear_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def gradient_step(self, alpha, lambda_param):
102102
# Vectorized version of gradient descent.
103103
theta = theta * reg_param - alpha * (1 / num_examples) * (delta.T @ self.data).T
104104
# We should NOT regularize the parameter theta_zero.
105-
theta[1] = theta[1] - alpha * (1 / num_examples) * (self.data[:, 0].T @ delta).T
105+
theta[0] = theta[0] - alpha * (1 / num_examples) * (self.data[:, 0].T @ delta).T
106106

107107
self.theta = theta
108108

0 commit comments

Comments
 (0)