Implement simple linear regression using gradient descent from scratch. Given paired data (X, Y), write code to learn the regression weights by iteratively minimizing the Mean Squared Error (MSE) loss. You must correctly compute MSE — i.e., sum of squared residuals divided…