Your question is Implement Gradient Descent. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Plymouth Rock Assurance is prototyping a simple claim-severity model: prediction = weight * x + bias. Implement batch gradient descent to minimize mean squared error across training examples.
Implement gradient_descent(x, y, learning_rate, iterations).
x is a list of numeric feature values.y is a list of numeric target values, where y[i] corresponds to x[i].weight = 0.0 and bias = 0.0.error_i = weight * x[i] + bias - y[i]d_weight = (2 / n) * sum(error_i * x[i])d_bias = (2 / n) * sum(error_i)[weight, bias], rounded to 10 decimal places.def gradient_descent(x, y, learning_rate, iterations):