Machine Learning, Linear Regression, Gradient Descent, Python, Stochastic Gradient.
get b0 and b1 at t+1 b0, b1, g_b0, g_b1 = stochastic_gradient_descent(b0, b1, stepsize, yi, xi) b0_sgd.append(b0) b1_sgd.append(b1) # collect gradient_vector_length for plot gradient_vector_length.append(np.sqrt(g_b0**2 + g_b1**2)) # check is gradient vector size is smaller than tolerance satisfied