Machine Learning, Python, Linear Regression, Gradient Descent, Regression Analysis.
= theta - lr * grad # Compute and store the cost function value cost_list[i] = cost_function(X, y, theta) theta_list[i,:] = theta.reshape((1,2)) return theta, cost_list, theta_list # dummy data X = 2 * np.random.rand(100, 1) y = 4 + 3 * X + np.random.randn(100, 1) X_b = np.c_[np.ones((100, 1)), X]