Your question is Linear Regression with 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.
Given two integer arrays x and y of equal length, implement batch gradient descent for univariate linear regression. Write a function that runs a fixed number of iterations to learn parameters w and b for the model y_pred = w * x + b, and return the final [w, b] as floats.
def fit_linear_regression_gd(x, y, learning_rate, iterations):