import numpy as np def gradient_descent(X, y, w, b, learning_rate, iterations): m = len(y) for _ in range(iterations): predictions = X.dot(w) + b errors = predictions - y gradient_w = X.T.dot(errors) / m gradient_b = np.sum(errors) / m w = w - learning_rate * gradient_w b = b - learning_rate * gradient_b return w, b X = np.array([ [1000, 2, 0], [2000, 1, 1], [3000, 3, 0], [2000, 4, 1], [4000, 2, 0], ]) actual_times = np.array([16, 29, 28, 35, 31]) __ __