Machine Learning, Data Science, Programming, Python, Statistics.
operation will look as follows. theta1_new = theta1 - 0.01 * (1/len(x)) * sum([theta1 + theta2*x[i] - y[i] for i in range(len(x))]) theta2_new = theta2 - 0.01 * (1/len(x)) * sum([x[i]*(theta1 + theta2*x[i] - y[i]) for i in range(len(x))]) theta1, theta2 = theta1_new, theta2_new The loss function is