import numpy as np def gradient_descent_vectorized(x, y, w, b, learning_rate, iterations): m = len(x) for _ in range(iterations): predictions = w * x + b errors = predictions - y slope_w = np.sum(errors * x) / m slope_b = np.sum(errors) / m w = w - learning_rate * slope_w b = b - learning_rate * slope_b return w, b distances_np = np.array([1, 2, 3, 4, 5]) actual_times_np = np.array([12, 17, 22, 27, 32]) final_w, final_b = gradient_descent_vectorized(distances_np, actual_times_np, w=0, b=0, learning_rate=0.01, iterations=10000) print("Final w:", final_w) print("Final b:", final_b) __ __