Machine Learning, Python, Linear Regression, Gradient Descent, Regression Analysis.
np.random.rand(100, 1) y = 4 + 3*X1 + 2*X2 + np.random.randn(100, 1) X_b = np.c_[np.ones((100, 1)), X1, X2] # initialization theta = np.random.randn(3, 1) # calculate gradient descent theta, J_history, theta_history = calc_gradient_descent(X_b, y, theta, lr, num_iters) # plot fig =